.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

asp Hyperlink control using query string

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net

Here is my problem:

I am passing a Customer ID using query string, however I also want to pass in a mode.  For example if the user clicks edit, I am using the hyperlink to re-direct them to the update Customer page.  In the hyperlink control I have a query string that is passing Customer ID and that works great, I also want to pass in MODE="E" (mode equals edit).

I am using the same Customer Edit page to edit current customer information and I am accessing it from an Add New Customer button.   I want to be able to pass in mode so I know whether they are editing or adding a new record.  I will then using this in code to determine what to do.

Here is what I have tried:

<asp:HyperLink ID="customer" runat="server" NavigateUrl='<%# "CustomerEdit.aspx?ID=" + Eval("CustomerID") &MODE="E" %>' Text="Modify" />

I keep getting an error that MODE does not exist in the current content...

Any suggestions???

View Complete Post

More Related Resource Links

Need Help in HyperLink with query string

Dear All,         I am using a hyperlink which Navigation Url is like                                                                     Indus.aspx?Ind="+indName+"&Value="+val  The indus page is not getting reloaded (There is one grid, whose rebind is not happening) and even i tried debugging. But it seems not entering the page. So i want to trigger a page load in query string . thats my only catch in this issue. are there any thing which cud be appended at the end of the above link to trigger a page reload? Please give your suggestion people.   Thanks in advance, Parthiban S.

How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

How to send an email with information in query string


First I will say I googled (Binged to make Bill happy) for this but could not find anything, perhaps I am not stating what I need correctly;

I have a website that a customer creates orders (for a printing company) and after the order, I would like to email the customer a link to view the status of their order;

I need to send the CustomerID in the link so on the returning page if a CustomerID is detected in the querystring, I "auto login" the client and open the "Dashboard" for the order page for that customer.

Can anyone point me in the right direction as to how to send the link and how to parse the querystring to get the values from the link;

Thank you if you can point me in the right direction.

how to assign string value to a label control


When i do the following i am getting object ref not set to instance of an object:

there is value in string variable would like to assign to a label.

lblFilename.Text = strFilename


Thank you very much for the helpful info

Getting URL without Query String

Is there an easy way to get the URL portion without the query string of a given URL?

E.g. http://www.abc.com/?a=b&c=d --> http://www.abc.com/

adding parameter to query string


hi all,

how do i add a new parameter to an existing query string?


now i need to add a new parameter say, showsearch.

Validation Control Query



I've read that if you put a validation control on a page it performs the validation on the client AND server side.

My question is, if you've got a button's click event and you put code in there that puts submitted data into a database, how will the validation controls stop the data being inserted?

Is validation simply performed before anything else, then the page just stops?

Need help with validating an alphanumeric string within a textbox control.

Hi everyone,I am developing a simple WinForms app for a presentation next week and need to validate that a particular string in a particular textbox is alphanumeric.  I have included the code from the button click event handler below: // Alphanumeric private void btnValidate4_Click(object sender, EventArgs e) { try { if (txtAlphanumeric.Text == "") MessageBox.Show("Please enter an alphanumeric string before clicking the 'Validate' button.", "Whoa there, pardner!!", MessageBoxButtons.OK, MessageBoxIcon.Information); else { Regex rgxAlphanumeric = new Regex("^[a-zA-Z0-9]*$"); Match alphaNumericMatch = rgxAlphanumeric.Match(txtAlphanumeric.Text); if (!alphaNumericMatch.Success) MessageBox.Show("The string supplied does NOT match the specified pattern.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); else { MessageBox.Show("The supplied string matches the specified pattern.", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

query string or session variable or neither for this scenario?

Hello,example scenario: user login has a list of associated 'accounts' it has access to... this list of accounts is stored in a database table, say tblAccountAccessControl, something like:login, accountID-----------------------userA, account123userA, account456userA, account798userB, accountABCuserB, accountDEFetc..this info is used throughout the web application and determines the 'domain' of information the particular login has access to. For example there are many other tables that have the 'accountID' field and whenever a page pulls data from the table it only pulls data that the currently logged in user should be allowed to see, based on that tblAccountAccessControl data.the security question:1) do I need to query the database every time I need to get this list of allowed accountID's? I was about to use a plain old query string to pass a particular accountID to another page but quickly caught myself as I realized that would be a major security flaw (the receiving page was going to use that accountID to grab info from the database, and there would be nothing preventing a user from simply typing in a url manually to get data from an accountID they are not supposed to be allowed to view). So I then thought I'll just store the list of accountID's in a session state variable so they will be carried with the user throughout the sessi

I want to encrypt the query string appearing in the URL

I want to encrypt the query string appearing in the URL when pass to other page. For Example: I have a Hyperlink column in GridView  when I click on the link, I pass a parameter to another page. This parameter should not be displayed in the URL as a true value but encrypted. Any help will be most appreciated.  If possible, please provide example. Thank you.  

Grid control displays a hyperlink. (in WPF)

Hello, I'm making application, that's received a text from web.   get the text following the code is shown below.   For Each Status As Status In A.GetList grdList.RowDefinitions.Add(New RowDefinition() With {.Height = GridLength.Auto}) Dim TextBlock As New TextBlock() TextBlock.Margin = New Thickness(4) TextBlock.TextWrapping = TextWrapping.Wrap TextBlock.Inlines.Add(Status.Text) Grid.SetColumn(TexatBlock, 1) Grid.SetRow(TextBlock, grdList.RowDefinitions.Count - 1) grdList.Children.Add(TextBlock) Next TextBlock is added, the grid view control does not display a hyperlink. So, Does not display the URL as a hyperlink. What should I do in the grid control will display the URL as a hyperlink? plz, help me

Pass XSL "Currently Selected" Value via Query String

Hi, I have a DVWP with an ID column, that's connected to other webparts on the page to filter their values accordingly.   I also have a "Print" button that opens a custom ASP page that's essentially a print-friendly single item data view.  How do I pass the "selected item" value to the URL when a user hits the print button? I've already set up the "ID" parameter and filters on the target page, just need to know how to get the value info from the list ID field inserted into the URL upon button click.  Thanks in advance

Duplicate URLs in Source Parameter of Query String for All SharePoint Lists

After performing a database attach method of upgrading our existing web application from MOSS 2007 to SharePoint Server 2010, all of our lists that migrated now exhibit an interesting but undesirable behavior.  The DispForm.aspx and EditForm.aspx pages that get loaded are given the Source parameter of the query string but instead of the URL being a single entry like: Source=http://sharepointsite.domain.com/Pages/Default.aspx It winds up putting the URL twice like this: Source=http://sharepointsite.domain.com/Pages/Default.aspx,http://sharepointsite.domain.com/Pages/Default.aspx Naturally this makes processing of the form -- either by choosing OK or Cancel buttons -- result in an HTTP 404 error.  The question we're left with is how in the world did the Source parameter get set that way to begin with.   It wasn't that way in 2007. We had thought that perhaps there was something that didn't migrate over correctly for the existing lists, so I tried creating a new list and then added a new item to the list.  So far so good.  Then attempted to Edit Properties or Edit Item or even View Item, etc. -- essentially triggering the load of the EditForm.aspx and DispForm.aspx  -- and we received the 404 again.  At this point we're not sure what's going on or how to fix it.  We've performed the migration three times so far with t

using a database field as a hyperlink query?

I have three tables in my sql database contactssurvey answersrespondent_initialContacts holds all customer data with custid. survey answers has assigned everyone how took the survey a number in a field called respondent_no.respondent_initial holds input from a webform where I populated it with the custid from contacts and respondent_no from survey answers before the webform input is inserted. I want to send an email to them that had there respondent_no in a hyperlink to the webform so that when they entered their data into the webform it would use the repondent_no to determine where to insert the form data.Example joe clicks http://www.myplace.com/order.aspx?23             Mike clicks http://www.myplace.com/order.aspx?125it would look up respondent_no (23) from the respondent_initial table and insert the data in that row in the database for joe's webform entry and it would look up respondent_no (125) from the respondent_initial table and insert the data in that row in the database for mike's webform entry.my code behind looks like this// Create command                comm = new SqlCommand("INSERT INTO respondent_inital (Practice_Name, Address1, Address2, City, State, Zipcode, Phone, Email, Contact, Dealer, item_9223, item_9129, item

How to filter managed meta data column using page query string?

I have two managed term sets as follows: Articles:Downloads Projects:Downloads I am trying to use a content query web part to filter a list based on the above manged meta data column. I want to filter out only "Articles:Downloads" Scenario 1: When I edit the web part and directly set the filter option with the managed meta data column to "Articles:Downloads" it works fine. When I export the web part, in the .webpart file, the "FilterValue1" property has a value "Downloads|9096e43b-555d-4879-9acc-b4ada9ea9910". Scenario 2: I want the web part to get the filter information from query string [PageQueryString:pageType]. So I tried using these options: a) pageType=Downloads      This works but returns downloads under 'projects' as well. (i want downloads only under 'articles')  b) pageType=Articles:Downloads     Does not work and shows no records c) pageType = Downloads|9096e43b-555d-4879-9acc-b4ada9ea9910     Does not work. (This value is the same as one found in 'FilterValue1' of the static web part). c) pageType = Articles:Downloads|9096e43b-555d-4879-9acc-b4ada9ea9910     Does not work. d) pageType = 9096e43b-555d-4879-9acc-b4ada9ea9910     Does not work.   What am I missing here? Can some one please help?

Need to Change a Query String in a DataSet

I need help in pointing me in the right direction...   I have a microsoft Report (ViewDelete.rdlc) that is feeding from a DataSet(ViewDeleteDataSet.xsd). A Web Form has been created with 3 Textboxes: -Search by VehicleNr -Search By VIN -Search By TagNr The Same Web Form as Microsoft ReportViewer loading the above mentioned report.   What Needs to Happen: 1. User entered search information into one of the textboxes and clicks Search 2. Query string for the Report is updated to list only the information the user is wanting to see and reloads the report based on this query.   I have been searching for about 4 hours with no luck on how to do this.  I maybe way off on how this should work, can someone help get me going?

xml nodes query on DataContractSerializer string

Hi I need to get a table from this xml, I have some experience using nodes but am getting nowhere on this string.  It is produced from DataContractSerializer on a list with one of the columns a dictionary.  Any help will be much appreciated!  declare @xml xml = ' <ArrayOfArmorDeviceBase xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://server.armor.com/contract/data">   <ArmorDeviceBase xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" z:Id="i1" i:type="ArmorSimpleDevice">     <Id>5000</Id>     <SiteId>0</SiteId>     <SourceSystem>Armor</SourceSystem>     <DataGroups xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">       <d3p1:KeyValueOfstringDeviceDataGroupBaseRRFhSxY9>         <d3p1:Key>CommunicationStatus</d3p1:Key>         <d3p1:Value xmlns:d5p1="http://server.armor.com/contract/data/ControllerStatus" i:type="d5p1:CommunicationStatus">           <Ticks>0</Ticks>           <d5p1:Status>Disco
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend