•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 427,760 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,708 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 5634 | Replies: 10
![]() |
•
•
Join Date: Jun 2006
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
i need to use the variables declared in javascript in asp.net
saw a thread suggesting hidden textfields
but that wud help in request or query strings
what if i needed to use the value of a variable declared in javascript by fulfilling some condition into an INSERT COMMAND.
the page will not be posted back
n the client side script sets the value for the variable
how do i incorporate the value in asp.net
saw a thread suggesting hidden textfields
but that wud help in request or query strings
what if i needed to use the value of a variable declared in javascript by fulfilling some condition into an INSERT COMMAND.
the page will not be posted back
n the client side script sets the value for the variable
how do i incorporate the value in asp.net
•
•
Join Date: Jul 2005
Location: Dallas, TX
Posts: 481
Reputation:
Rep Power: 4
Solved Threads: 19
Step 1: the asp code is handled by the server before the page is returned to the client.
Step 2: the javascript is handled by the clients browser after the page is returned to it
Step 3:the javascript can then affect whatever (which boxes are checked, the value of fields, etc) which can then be sent back to the server, either as a post back or posting to a new page.
which step are you trying to manipulate?
Step 2: the javascript is handled by the clients browser after the page is returned to it
Step 3:the javascript can then affect whatever (which boxes are checked, the value of fields, etc) which can then be sent back to the server, either as a post back or posting to a new page.
which step are you trying to manipulate?
•
•
Join Date: Jun 2006
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by campkev
Step 1: the asp code is handled by the server before the page is returned to the client.
Step 2: the javascript is handled by the clients browser after the page is returned to it
Step 3:the javascript can then affect whatever (which boxes are checked, the value of fields, etc) which can then be sent back to the server, either as a post back or posting to a new page.
which step are you trying to manipulate?
thanx for the quick reply
my prob is that ....say suppose we do not want to affect any field
just declare a value which is to be posted
we can assign the value to a hidden text box....but any other way???
A web browser, regardless of which, can only communicate to a web server via an HTTP REQUEST, which come in two flavors: POST, and GET.
POST = A form.
GET = A querystring.
That's all.
A server-side language, such as ASP.NET or any other, can only generate a RESPONSE. That response can be any document for which there is a corresponding MIME type. If HTML, you can place HTML, CSS, and JavaScript in the response.
Despite all the fancy bells and whistles in ASP.NET, all it does is generate RESPONSE objects. It can do all sorts of fancy stuff along the way, but that's the final result.
There are a couple of different mechanisms for shuttling values between the client and server.
One of them is the ViewState, which on the client side is a big nasty encoded hidden input element, but on the server-side becomes an "object" with methods and properties.
The other is to use ASP.NET to create client-side scripts and place them in the RESPONSE.
POST = A form.
GET = A querystring.
That's all.
A server-side language, such as ASP.NET or any other, can only generate a RESPONSE. That response can be any document for which there is a corresponding MIME type. If HTML, you can place HTML, CSS, and JavaScript in the response.
Despite all the fancy bells and whistles in ASP.NET, all it does is generate RESPONSE objects. It can do all sorts of fancy stuff along the way, but that's the final result.
There are a couple of different mechanisms for shuttling values between the client and server.
One of them is the ViewState, which on the client side is a big nasty encoded hidden input element, but on the server-side becomes an "object" with methods and properties.
The other is to use ASP.NET to create client-side scripts and place them in the RESPONSE.
Last edited by tgreer : Jun 21st, 2006 at 4:21 pm.
It's not going to post back? Yeah, that's a loaded term. He could be saying that he's testing for "IsPostBack" on Page_Load, and not seeing the value there. If that's the case:
Of course you wouldn't. Only server-controls have their values from the Form stored with them. If you're using an HTML hidden element, or a QueryString key-value pair, you need to find it's value in the REQUEST object.
Or, he could be saying he isn't going to "post" the value "back" to the server application... in which case, this isn't an ASP.NET question, it's a JavaScript/HTML question.
adnan: sorry, but you need to ask extremely clear questions. I know we probably have a language barrier, but keep trying. We all want to help. Can you share some of your code with us? Perhaps that would help.
Of course you wouldn't. Only server-controls have their values from the Form stored with them. If you're using an HTML hidden element, or a QueryString key-value pair, you need to find it's value in the REQUEST object.
Or, he could be saying he isn't going to "post" the value "back" to the server application... in which case, this isn't an ASP.NET question, it's a JavaScript/HTML question.
adnan: sorry, but you need to ask extremely clear questions. I know we probably have a language barrier, but keep trying. We all want to help. Can you share some of your code with us? Perhaps that would help.
Last edited by tgreer : Jun 21st, 2006 at 4:48 pm.
•
•
Join Date: Jun 2006
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
thanks every one for the quick n prompt replies
i guess wud help a lot if i post my code.....
but right now i got over with my problem
one thing i want to assure u is that if i am not clear in my question ....it is because i am a newbie to programming....not because of a language barrier
thanx everyone once again
next time i have a problem i know where to post it
i guess wud help a lot if i post my code.....
but right now i got over with my problem
one thing i want to assure u is that if i am not clear in my question ....it is because i am a newbie to programming....not because of a language barrier
thanx everyone once again
next time i have a problem i know where to post it
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Using Hidden Variables in ASP.NET (ASP.NET)
- ASP.NET and JavaScript (ASP.NET)
- Calling C# function through Javascript in ASP.NET (ASP.NET)
- Javascript:How to transfer values between ASP.NET pages (JavaScript / DHTML / AJAX)
Other Threads in the ASP.NET Forum
- Previous Thread: Date and Time
- Next Thread: Where is the table ????



Linear Mode