473,326 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

store value of request.querystring("id") after postback

11
i have this command on page load event
when page first time loaded value of querystring is 1 for Ex.
but second time it becomes null
i am doing paging in repeater
cmd.CommandText = "select * from catinfo where catid=" & Session("id") & ""
May 15 '07 #1
2 3056
prabunewindia
199 100+
hi friend,
i am not getting you.
you start with querystring and shown session in code
plz be clear(if u not explained clearly) or give some more details, code u used
Prabu

i have this command on page load event
when page first time loaded value of querystring is 1 for Ex.
but second time it becomes null
i am doing paging in repeater
cmd.CommandText = "select * from catinfo where catid=" & Session("id") & ""
May 15 '07 #2
Plater
7,872 Expert 4TB
Try something like this:
Expand|Select|Wrap|Line Numbers
  1. if (request.params["id"]!=null)
  2. {//an "id" was sent to page
  3.    Session.Add("id",request.params["id"]);
  4. }
  5. else
  6. {//no "id" was sent to page
  7. }
  8.  
  9. if (Session["id"]!=null}
  10. {//there is an "id" stored in the session, 
  11.  //whether it was already there or just inserted byt the request.params["id"]
  12.    //do your SQL query here
  13. }
  14. else
  15. {//you have no "id" to work with
  16.    //do some kind of error response, like "Please choose an id first"
  17. }
  18.  
May 15 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Russ Perry Jr | last post by:
I'm using "ID" and "Value" in the generic sense here... Let's say one page I had a <html:select> with a collection like this: <html:options collection="items" property="key"...
8
by: Sam Sungshik Kong | last post by:
Hello! I use Python for ASP programming. I found something weird. Response.Write(Request("something")) It draws "None" when there's no value for something. Actually I expect "" instead of...
22
by: David. E. Goble | last post by:
Hi All; I have a few of these; sigsImages="sigs/finished1.jpg" sigsImages="sigs/foghorn.jpg" lower I have;
4
by: Guoqi Zheng | last post by:
On my application, I need to have different action based on the pass in query string. When the query string is not presented, I try to use If request.querystring("id") ="" THEN ...... This is...
2
by: IkBenHet | last post by:
Hello, I am uploading a file using this form in ASP.NET. I have also added a simpel textfield: <form runat="server" enctype="multipart/form-data"> <input type="file" id="oFile" Name="oFile"...
0
by: Dave | last post by:
A web page of mine looks something like: .... code ... <form id="formOne" action="Process.aspx" method="post"> .... a bunch of code ... </form> .... more code ... <form id="formTwo"...
2
by: mstearne | last post by:
Has anyone seen any Javascript that mimics the effect that allows you to browse through the New Releases, Just Added sections of the iTunes Music Store? Where you click the arrow icon and the next...
6
by: sattu | last post by:
i want to store value of querystring("id") when page postback
0
by: David | last post by:
Hi, I have an asp page which lists records. Each record has an ID appended to it. On the following edit page, I am trying to test against a certain field value, if it is >0 then run the update,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.