Update a field in a page, from another page in ASP.NET - asp.net

I want to make a link on a page that when clicked, would open another page(tab). I have already done that.
Now, when the user clicks a link in the second page, I want the page to close, and a field in the first page to be updated with what the user selected in the second page.
As an example, I would like to achieve the same functionality as the Yahoo Mail address book. When you write a message, you click the "To:" field, the address book opens in a new window, you select the people you want to send the mail to, and then when you click "Done", those people's addresses are automatically added to the "To:" field in the first page.
Please give me some suggestions on how to achieve such a feature.
Thanks in advance

You'll need to use JavaScript to open and close the window. When the second window closes, handle the event and then you can use window.parent.document to find and access fields on the parent window.

Related

Is there an option to track(goals) ajax form with checkbox that works screen by screen?

I have an ajax form with some questions of choice but every question will be displayed on new screen (screen by screen) by button.
I want to track users behavior on my form page. I want to know after which question user has left the page (which questions they filled up)
Also I would like to know from which devices they have visited the form page and how long they were on this page
Is it possible to track all of this by GA or GTM?
If the form is screen-by-screen as you said, it sounds like you need to track two things.
An event for clicking the "Next" button
A virtual pageview for each screen.
This way, you can look into your Exit Pages report to see what screen the left the page from.
As for device tracking information, that type of data is automatically captured by GA.
So, basically. You'd have a virtual pageview for the first screen (assuming this form is a popup modal). If it's not a popup modal, then you'd just have the normal pageview for that first screen.
For instance, if the user has to click a link/button for the form to start, then you'd, ideally, fire an event for clicking that link/button, fire a virtual pageview when the first screen loads, fire an event when the user clicks the next button, then rinse and repeat for the subsequent screens.
Also, it may be a good idea to track the last screen's "next" button (or "finish") button as a separate event. Then, you can see in your events report who has filled out all of the screens and submitted.
Another thing worth pointing out: If you also want to show which question was the last one filled out, you can provide the name of the question (or an id, or some kind of brief and canonical identifier) in the virtual pageview as a custom dimension.

ASP.NET Multiple links validate

I have about 50 or so links similar to the following:
<asp:TableCell Font-Bold="true"><asp:Hyperlink ID="Hyperlink9" runat="server" CssClass="Hyptext" Name="HypLink1" TextDecorations="None" NavigateUrl="~/Folde1/Second.aspx" Text="Case Study 12 "/></asp:TableCell>
What I like to do is when the user clicks on the hyperlink, I like to validate that the user has permission to view the links. If so, they can view it. If not, a pop-up will come information them that they need to sign in order to view the links.
Questions
1) What is the best way when the user clicks on the HyperLink to do a server side click event. From what I seen,only a client side even can be done with the asp:Hyperlink. I like to then validate if they have permissions. If not, throw a pop-up window.
You should not do that. Instead, you should...
On server side, check to see if user is logged in...
if not logged in, provide login link and text "Login to see case studies".
if already logged in, provide links user has access to.
You need an onClick tag that points to a method. Create one event handler function and point all your hyperlinks to it. Once the event handler fires, cast the sender to Hyperlink and go from there.

Marketo Forms2: How to track source

I can track the source of a lead doing go.example.com/?src='ThisSite' . What I don't know is how to track a form2 that was embedded and I don't find any information. Does anybody know how to do that? thanks!
To accomplish this, you will need to create a hidden field in your form that is auto-populated with the value of the referring page. Here's how to do this in Marketo:
Log in to Marketo
Under Marketing Activities, select your form and click Edit Form
Create a new field
Change the field type for the field you created to hidden
Select the option for Autofill
After the clicking option for Autofill, set Get Value From to Referrer Parameter.
Enter the Parameter Name which you want to get from the referrer URL and click SAVE.
Click Finish
Click Approve and Close

hyperlink and responce.redirect

I am new to asp.net and i need to know
whats the differences between a button with response.redirect behind it
and a hyper link ? they get you both to the page but one is server side while the other is not
is it the only difference
and when it is best to use either one of them
A hyperlink render a link to the given NavigateUrl in the browser. When the user clicks on it, the browser directly goes to the destination.
A button with redirect renders a button which does a postback using javascript. When the user clicks on it, a postback is done to the same page and the browser is instructed to go to another URL using Response.Redirect.
The main difference is that the second solution loads the same page again, while the first solution goes directly to the destination. With a button you can run some code before redirecting, or redirect to a different URL based on the information in the postback. Because it loads the original page before loading the destination page, it is a bit slower.
With a hyperlink, the visitor will see where the hyperlink leads to. With a button you can not see this. A hyperlink is thus better for search engines, because they will follow a hyperlink and will not follow a button.
If you know the URL in advance and you do not want to run extra code when the user clicks on something, use a hyperlink. Else, use a button.
A hyperlink is a link which will redirect you somewhere in the same tab or in a new tab when you click on it.
In case of response.sendredirect() the user's browser is redirected to a link sent by the server depending on your business logic.(the link may belong to some other domain).
hope that helps
Hyperlink control
This is server control use for navigation to another page specified in the NavigateURL property. Hyperlink control doesn’t expose any server side event.
Response.Redirect method
This method is used to navigate to another page from code. You can use this method to navigate from a Linkbutton or ImageButton control.

Anchoring to clicked item in asp.net page

I've a datagrid on an asp.net page "A" which shows different customer orders.
On clicking on one any row/OrderId,user is redirected to another page "B" which displays order details.
When user clicks "Back to Page A" on page B,I need to have the same order Id "anchored" on page A.
How do i achieve this functionality in asp.net?
Thanks for reading.
Joel's answer is correct, however, if you have a more complicated scenario you could do the following.
Modify the display on Page A to render an <a name="myRecord" /> for each row of the grid.
On page B, you can redirect back to page A and pass #myRecord at the end of the url, to navigate to the specific entry.
In most browsers, the back button remembers where your were in the page. So a simple javascript:history.go(-1) should do just fine, and anyone who doesn't have javascript enabled can just click the back button.

Resources