Hyperlink and Dynamic Search - asp.net

I have an interesting task that I'm not sure if possible. I've built an extensive web application via asp.net. Here is the task I want to attempt...
User receives an email from the system. Inside of the email is their submitted ticket information along with a hyperlink. That hyperlink will currently take them to the search page of my web application. What I'd like to do is have the hyperlink take them straight to their ticket without them having to search for it. So click link, takes them to search page, they click a radio button to search for ticket number and then submit. I'd rather they didn't have to do that but have it take them straight to their ticket. Is there a way to do this? I've searched for several days and can't seem to find what I'm looking for or maybe I'm seeing it but just don't understand it.

Related

Process flow for authenticating a user from a popup div

I have a checkout process that lets users add items to cart, and they are able to go through the first step of the checkout before logging in. Once it gets to the part where they have to log in, I'd like to use a popup div for this rather than redirecting them to a login page so it doesn't feel like they're leaving the checkout process.
I'm not sure what the best way to implement this is though. In a perfect world, there would be a way to integrate this idea with the existing asp.net forms authentication and it would popup the div over the page you're already on before redirecting to the protected page. I don't 'think' that's possible though so wondering how else could I do this?
There are a variety of ways to skin this cat. If you are a bit more old school, you can use the AJAX bits and modal popup control extender. If you are not using the AJAX bits for anything else, I would not go this direction.
A newer approach would be something like a JQuery popup: http://www.formget.com/jquery-popup-form/
As JQuery is integrated with ASP.NET now, this is a much more modern approach.
The key here is making the call outside of the page context, which means JavaScript (AJAX is essentially JavaScript (and XML - as the name implies)). You then can bring the user's context into play without sending to a login page and then bringing them back to the cart checkout page.
There are other JavaScript libraries that can be used for the same purpose. I would google login popup JQuery (or other library) and you will likely find a full implementation somewhere and save yourself time inventing it.

How to code an "create new employees" button

I'm building a web application as an apprentice developer, and I'm stuck completely on how to have this "add information" button? Would it need to be in a <table>?
Hmmm that's quite a vague question but I will try and help and give you a direction to Google things.
You might want to add a input button to your html for the user to click on. When the user clicks on the button you call a technology called JQuery which can then pass information from the client to the server via a technology called AJAX. AJAX can pass information from text fields of your new employees to the server.
Now in the code behind you can then call stored procedures and edit your database.
If you google the bolded text you should get a bit further with your endeavor.
Good Luck!
P.s I am from a C# ASP.net back ground.

Possible to only update part of page and change query string parameters at same time in asp.net?

Is there a way to only update part of the page and update the query string parameters at the same time without completely refreshing the whole page in ASP.NET?
I only need to update the "main" section of my page and not the whole page. I understand I can do a partial page postback (or use asp ajax) to do the partial page update, but then how do I update the query string parameters in the URL at the same time? Is that even possible?
Or is it not possible and I'll have to just do a Response.Redirect in the code behind of the partial page postback redirecting to the same page with new query params and just let the whole page refresh?
Use pushState.
This new feature offers you a way to change the URL displayed in the browser* through javascript without reloading the page. It will also create a back-button event and you even have a state object you can interact with.
window.history.pushState(“object or string”, “Title”, “/new-url”);
Described here
You have absolutely zero programmatic access to the address bar. The only way to change it is to redirect.
You could, however, do it like some sites do and provide a "send a link to this page to your friends" area. Youtube comes to mind - see how it provides a URL, querystring parameters included, for you to copy, should you wish to send someone a link to a video starting from some specific point.
Also check the handy "Share" link right under your question. You could provide a link like that, with the target URL, so for the user it's just a matter of right-clicking and copying from the context menu. A link well structured into your site is more user friendly than having the user copy directly from the bar, or from a text box. Specially for mobile browsers, where the sequence is usually press-and-hold, then copy. Copying from the address bar, on the other hand, may involve selecting the address bar text, which in some Android devices is a pain in the ass.

Tracking actions like selecting a checkbox

I have some check boxes on my website selecting which the data on the page gets filtered but the page name remains the same. I want to capture the data for visitors selecting any of the check boxes. Can you please let me know how can this be done?
Presently, I have different page name whenever the user select any of the check box. But by doing this, Page views data for that page becomes irrelevant.
For Omniture tracking, that's very possible, but you need to add a bit of javascript. You need to add an onClick event for the checkbox, and have it submit a custom link event to Adobe. They provide a function for it:
s.tl(this, 'o', 'Checkbox X Clicked');
Prior to this call, you can set props/evars if you want other tracking tied to this event. It doesn't count as a page view, though.
The Omniture implementation guide is here:
http://microsite.omniture.com/t2/help/en_US/sc/implement/oms_sc_implement.pdf... do a search for the s.tl() function. It'll explain.
Presumably, your page has JavaScript that does the filtering.
You would need to add to this JavaScript to send an AJAX request to the server every time the user makes their selection. The server will need to track the requests in a database or a file. After that, you can analyse the results.
There are many ways to send AJAX requests in JavaScript. The basics are here: http://www.w3schools.com/ajax/default.asp but there are also 3rd party libraries available.
Unfortunately there is nothing that "google-analytics' can do for you here, as far as I know.
Good luck,
DC

How to keep a rendered page for later usage (to resend it later)

I have an asp.net application with a search page, with criteria and result display on the same page. I want to keep a copy of the populated search page to redistribute it later to the same user, upon the button click on another page. It's kind of a "return to search" button. How can I do that?
Here is some context:
The search criteria is made up of some basic controls, and the results are then (after postback) displayed in a GridView. I also have a master page. Simple as that.
Now consider the following scenario: The user can investigate the results by clicking links that show detail pages, and can drill down over quite many detail pages with associated data. If he/she wants to get back to the search results he/she needs to click the back button of the browser quite many times.
I would like to provide a "Back to search" button on the master page that allows to return to the populated search page with one click.
Note:
I can not use the browser history in any way because it must work also when the user opened one of the detail views in another tab.
I have seen Keeping the Viewstate persistent and retrieve it on demand but it hope there is an easier solution because my grid is paginated and I have also more than one search page, where I would like to return to just the last one used.
Thanks, Marcel
I can offer some logical ways to resolve this problem, without using specialized asp.net features if they exist:
1) Is there some way to save the search string in GET request? So you can save it some way between moving through pages?
2) Another way is caching search pattern (with all filters or what you need there) somewhere - in database, for example and contain some key in get request, which would point on this pattern.

Resources