Query string in a DataList control?

.net , asp.net Stockholm, Sweden
  • 12 years ago

    Hi, I'm quite new to ASP.NET and I have a problem that I hope someone might be able to help me with (I use VS2005/ASP.NET 2.0)

    The idea is that the user will use a TextBox control on Page1 to search for an item, the search will go to a stored procedure, and the stored procedure will return the result to Page2.

    I want to use a DataList control on Page2 to show the result of the search, and in order to do that I guess I have to use a query string as an inparameter in the DataList control, that's atleast the advice someone gave me.

    My question is, how will the query string look like?
    Are there any other options?

    Regards

    Hannes

  • 12 years ago

    This is not quite how asp.net works. first you would use one page with a textBox, button and dataList or gridView below them. when search word/s are entered and button clicked you make a connection to the DB use a sqlCommand object to call the stored procedure and pass in your search text as a parameter and bind the returned records to your datalist etc which displayes the results. There are heaps of code examples online or in the .Net documentation .

    Regards

    Brin

  • 12 years ago
    Thanks Brin for your answear. I solved the problem with a multiview.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Linux is only free if your time has no value” - Jamie Zawinski