I have a serious problem.
I have two pages (such as settingpage and MainPage). In settingpage, I have a switchbutton with two value (English and China)
I want when click on switchbutton don't navigate form page1 to page2 for sending data but I want change some data on page2 such as format number and ... without navigate or change page.
How I can do it?
Thanks.
There are a couple of ways with which you can achieve this.
Create a static variable on any of the pages and use it as PageName.variableName to access the variable or to set its value.
Use a singleton. http://msdn.microsoft.com/en-us/library/ff650316.aspx
Related
I'm pretty new to Razor Pages, and I'm trying to figure out how to replicate routing I have in my current Angular Page.
I have a base razor page that will be populated with different data depending on which parameter is passed to it. This is easy enough, and I know how to do this. However, my problem is in the routing because I want to be able to pass a readable parameter that is based off of the base URL. For example, I want to be able to do:
https://myURL/Band1
https://myURL/Band2
and have both point to the same page (but not the Index Page), consume the parameter "Band1" or "Band2" to display the associated information.
I understand how to consume the parameter, and how to get data, what I'm not clear on is how to do this routing based on the base URL. I can see how I'd do it if it were https://myURL/b/Band1 since I'd make a "b" page and accept parameters.
But how does one do this without that intervening segment of the URL? I need to be able to do this to not break existing links.
Thanks!
The docs for Razor Pages suggest you can create a page named Index.cshtml, which will act as the default where no page is specified in the URL.
Edit
If you want to preserve the parameterless index page, but have your page take its place when the additional URL part is provided, try the following in your page:
#page "/{bandName}"
I am using APEX from Oracle and have one interesting situation. As you might know, APEX gives you an opportunity to generate buttons with link on another page, transferring variables from one page to another.
Now I am creating an HTML region using "Static Content" and want to create a button in HTML with the same functionality as built-in in APEX.
Example of the APEX link:
'f?p=254:32:&APP_SESSION.::::P32_IST_SOLL,P32_MODELL,P32_ZEIT_ID,P32_TYP,P32_GEWERK:SOLL,&P2_MODEL.,&P2_AKT_MONAT_ID.,KREDIT,&P2_GEWERK.'
Every value between "&" and "." is a name of the variable on the current page. Do you have any ideas how to let variables into link and overcome this problem? Thank you.
You didn't really specify what "problem" you want to overcome so I'll try to cover as much as possible.
First problem I occured trying to achieve what you were trying
The Security > Page Access Protection page attribute in the target page is by default Arguments Must Have Checksum
You can either prepare your URL using the APEX PREPARE_URL function : https://docs.oracle.com/database/apex-5.1/AEAPI/PREPARE_URL-Function.htm#AEAPI160 (Safest option)
Or you could set the target page security setting to Unrestricted (which makes the page subject to URL tampering and could be a security issue)
The other problem I faced was that by default on apex the <button> type attribute is by default set to submit, which could be easily fixed like so:
<button type="button" onclick="window.location.href='f?p=&APP_ID.:3:&APP_SESSION.::NO:RP:P3_TARGET_1,P3_TARGET_2:&P11_ITEM.,&P11_OTHER.';">Button Text</button>
Where &P11_ITEM. is the assigned value of P3_TARGET_1 in the target page and &P11_OTHER. is the assigned value of P3_TARGET_2 respecting the same order the target page item's are called.
I am writing a program for managing an inventory. It serves up html based on records from a postresql database, or writes to the database using html forms.
Different functions (adding records, searching, etc.) are accessible using <a></a> tags or form submits, which in turn call functions using http.HandleFunc(), functions then generate queries, parse results and render these to html templates.
The search function renders query results to an html table. To keep the search results page ideally usable and uncluttered I intent to provide only the most relevant information there. However, since there are many more details stored in the database, I need a way to access that information too. In order to do that I wanted to have each table row clickable, displaying the details of the selected record in a status area at the bottom or side of the page for instance.
I could try to follow the pattern that works for running the other functions, that is use <a></a> tags and http.HandleFunc() to render new content but this isn't exactly what I want for a couple of reasons.
First: There should be no need to navigate away from the search result page to view the additional details; there are not so many details that a single record's full data should not be able to be rendered on the same page as the search results.
Second: I want the whole row clickable, not merely the text within a table cell, which is what the <a></a> tags get me.
Using the id returned from the database in an attribute, as in <div id="search-result-row-id-{{.ID}}"></div> I am able to work with individual records but I have yet to find a way to then capture a click in Go.
Before I run off and write this in javascript, does anyone know of a way to do this strictly in Go? I am not particularly adverse to using the tried-and-true js methods but I am curious to see if it could be done without it.
does anyone know of a way to do this strictly in Go?
As others have indicated in the comments, no, Go cannot capture the event in the browser.
For that you will need to use some JavaScript to send to the server (where Go runs) the web request for more information.
You could also push all the required information to the browser when you first serve the page and hide/show it based on CSS/JavaScript event but again, that's just regular web development and nothing to do with Go.
Does anyone know if it's possible to extract the URL and if a value is found within the URL to display/hide something?
For instance, if I have a navigation bar that I want to only display for pages that contain 'copier' and I have URL aliases setup, can I setup Views module (or something like that) to check the URL for the 'copier' value and if it's found to display the navigation? If so, how would I go about doing that?
I know there can't be duplicate URL aliases but if say I had them as:
node/Copier
node/Copier-training
Could I check that URL and see if copier is present, and if it is display the navigation assoicated with copier?
I'm not really familiar with Views.
Not sure if this answers your question or not, the mention of Views is throwing me off a bit, but I believe all you need work with is a Block. You put your navigation into the Block, and then set the "Visilibity Settings" to be
node/*copier*
and set "Show block on specific pages" to "Only the listed pages".
This would then show the block on any page with copier in the URL, however this would only work for URLs of the type node/blahblahblah, if you wanted it to also show on say a URL such as blog/copier-training you would have to add another line to the Visibility Settings of the Block
node/*copier*
blog/*copier*
and also for any subsequent drill-downs also, for instance say blog/richie/copier-training would require
node/*copier*
blog/*copier*
blog/richie/*copier*
alternatively you could write a whole load of wildcarded options that go as deep as your site URLs may go
*/*copier*
*/*/*copier*
*/*/*/*copier*
ad infinitum
which is probably better...
If you do want to show a View within the Block you can use the following PHP
<?php
//load the view by name
$view = views_get_view('sample_view');
//output the view
print views_build_view('embed', $view);
?>
Hope this helped.
I want to create an html page which contains a text box. When I am given input and the Enter key is pressed, I want it to go to another html page and display the typed keyword.
How can I do this?
I think you need to use a server-side scripting language to facilitate the manipulation of the inputted data on the form, so that it gets "saved" and displayed in the other html page. I suggest you try reading about PHP, and then turn to handling information in Web Forms...just a thought!
You can use Javascript for that. Check this Tutorial : How do I pass variables between two pages? (GET method)