Problem passing value client-side to server-side

I have a page that calls a pop-up while passing an encrypted value via a query string.

The value is encrypted on the parent client-side in javascript so it needs to be decrypted client-side as well.

This decryption occurs on closing the child (popup) and I am at a loss of when and how I should get this value to the server-side.

0
mrrogers
8/20/2008 7:04:01 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

4 Replies
1609 Views

Similar Articles

[PageSpeed] 0

On the popup you just want to process server side code? Anytime you can access for example the raw url:

string raw = Page.Request.RawUrl;

If you need to access any values on the client side you can access the url using javascript.

Another idea is to, on the code behind, to fill a textbox with the string you need. Using this approach you can red the textbox value on the client side:

1    // Get access to the textbox
2 var txt = documment.getElementById('<%= txtMyTextBox.ClientID %>');
3 4 // Alerts with the current text
5 alert(txt.value);
 
 
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
0
bass4g0d
8/20/2008 7:37:12 PM

No. I don't think you understand. I need to actually PROCESS the url (because it is encrypted) on the client side THEN pass it back to the server-side somehow and at some point.

0
mrrogers
8/21/2008 3:05:00 PM

Hi Mrrogers, 

We can store the value in a hidden field and add [runat=”server”] to its opening tag. Thus the value is available on the server side by retrieving the value of the hidden field.


Forward Sun
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Forward
8/24/2008 1:29:25 PM

 The value on the hidden field get updated by the server side. but the javascript cannot get the new value.

 

0
geljian_a
9/2/2008 3:56:46 AM
Reply:

Similar Artilces:

How to Access/Pass Server Side Array Variable at Another Web Form's Client Side
Hi All,I struck up with some intrested senario at my application development...hope some body will guide me or sends me some code snippets....Thanks in advance.Senario is like this.....in A.aspx (using C# .net 2.0 as code behind) I am going to have a array variable basically it is an TWO Dimensional array after populating the values in array I need to redirect/ reload another web form B.aspx, here i need to access the array in B.aspx client side JavaScript.How can I do this...Thanks AgainRaju Dont do a redirect but use server.transfer. That way the previous page will still hold its value, ...

How to pass values from client side to server side
Hi, Is there a way to transfer variable from a client loop to a server loop. For example: var clitest = 'test'; Now I would like to get test variable from javascript into a server string variable <% sertest = ?? %> I understand that this can be done by storing a variable into a hidden control for example and than access it using server side, but when I have to transfer an array for example it get's a little more complicated. I was wondering is there more efficient approach? You can't transfer arrays, only strings. To workaround this problem pass delimited stri...

How to pass the client side values to server side?
 hello to All,Actually i wanna implement a code like... a string in HTML textbox retrieve in server side control....suppose i hv a HTML control <input type="text" id="txtHTML"/>, and dis control  txtHTML.text="abc".now i want to retrieve dis client side string "abc" in d server side textbox named "txtASP"...which hs a property runat="server"so please give me an idea how to pass values from client side to server side.... hope u understand a problem... sam.  You could do this <input type="text"...

passing client side variable value to server side
 i have a grid and  by click on the rows, the onrowclick event is fired on client side. I want to pass the row index to the server side. As there are not sessions variables in javascript so i am stuck to pass the row to the server side.. I have made a texbox and set its valueto the index in the onrowclick event but when refresh calls, the text box became empty as the value set is on client side, i want page to persistthe value,  How can i do that? Tel me some way passing the row index to the server side?? Hi, You can call GridView_SelectedIndexChanging event on row click ev...

how to pass values from client side to server side #2
Hi Guys....               This is Aani....I'm using ASP.NET in C# language.i have created one webpage for get input from user(from java script inputbox).i want that entered data in server side operations.how can i pass that value from client side server side.i need proper code in C# language.reply me soon... Thanks is Advanced... Regards....Aani plz use hidden field.ur assing values to text boxes through java script. before post back call a java scipt function to assign value to hodden fieed. even u can add these ...

Client side code to pass values to server side variable?
Hi there, I have ListBox_SelectedTextChanged() method that creates another list box in the runtime as follows: // Get Action Level List lbxActionLevel = new ListBox();lbxActionLevel.ID = "ddlA" + i.ToString(); lbxActionLevel.Width = 100; lbxActionLevel.Rows = 2;SqlDataReader dr = new BusinessLogicLayer().bllGetActionLevels(); lbxActionLevel.Items.Clear();while (dr.Read()) {ListItem lAction = new ListItem(); lAction.Text = dr.GetString(1).Trim();lAction.Value = Convert.ToString(dr.GetInt32(0)); lbxActionLevel.Items.Add(lAction); lbxActionLevel.SelectedIndex = 0; } I ...

Passing a value from server side to client side without postback
My problem exactly is that on my aspx.vb code-behind, I can update the field using HiddenField ID = "hidSessionTimeout" Code-Behind: on Page_LoadhidSessionTimeout.Value = HttpContext.Current.Session.Timeout on ChangeTimeOutValue()hidSessionTimeout.Value = 5  Client-Side: var x= document.getElementById("hidSessionTimeout"); It seems that the javascript cannot get the latest updated value... Any ideas?    Any Workaround solution? did u keep the page load code in if(!IsPostBack)pavankumar geljian_a:  Client-Side:  var...

Problem in passing Listbox items from Client Side to Server Side
Hi ,I am populating a Listbox 'A' from client side using another Listbox 'B'. At the time of submitting the form I am not able to retrieve the items from the Listbox 'A'. I need the values of Listbox 'A' in the server side.  Please helpRavjeet why do not you use server control for the list box instead of the client side ???Fadil Alnassar www.fadilalnassar.com | FREE Nodil Tab Controlhttp://www.mefranchising.com So,What's the exact problem r u facing now. My sugession to you is to set hidden variable at the time of populating listbox. Please, update me with current s...

How to pass param values from server side to client side scripts
Hi, I have a page containing a datagrid with a list of geographic positions of interesting places. Users can filter this grid. Clicking an item the system displays the place on a map using MS Virtual Earth map component that exposes a client side javascript api. My problem is that the filtering is done on server side, but the map runs on client side. So during page load, I need to create long strings containing complex javascript codes on the server side, and add it as an event handler attribute to my components. This causes a lot of problems, for exemple...

server side control passing value of self in client side function
I have a server side dropdownlist control.It contains values as:"#00FFFF""#FF00FF""#FFFF00"When the selectedindex is changed by the client I want to assign the value of the dropdownlist to a <div id="example"></div> evelement.pseudo:document.getElementbyId('example').bgcolor=dropdownlist.valueHow can I do this? I think I somehow need to attach a function to my dropdownlist which passes its own value as a parameter to a function...any suggestions?Thanks!please mark answers as 'Answered' and post back solutions when you figure stuff out that isnt in the post already. You ...

Problem accessing server side array values from client side javascript function
i faced the following problem ..i have an array that store the values of a resultset row under the server side coding.How do i retrieve them under my client side javascript function.I wrote the following coding under my client side function and it got an error.BSCStr is an array storing data from a resultset row which i did under the server side coding. From client side function: addr=addr + "&C" + i + "=" + <%=BSCStr[i]%>;...

How do I pass client side values to server side ones & vice versa
Hi, If I have some jscript that creates a value based on a users input, how can I pass that to a server variable? Many thanks@nt Hi! You can set that value to a hiddenfield (runat = server) on the client and then read it from server side like any other control. If this is not clear, please paste your code so I may help you better.Regards,ClaudioSimplicity: "the art of maximizing the amount of work not done." Thanks for your time crfenix,  I need to do something like below: Code behind:protected void Page_Load(object sender, EventArgs e) {strin...

Problem accessing server side array values from javascript client side function
i faced the following problem ..i have an array that store the values of a resultset row under the server side coding.How do i retrieve them under my client side javascript function.I wrote the following coding under my client side function and it got an error.BSCStr is an array storing data from a resultset row which i did under the server side coding. From client side function: addr=addr + "&C" + i + "=" + <%=BSCStr[i]%>; First of all, you can't mix server-side and client-side code. The reason is that the protocol that is used to communicate betwee...

How can I set client side values as server side values?
Hi, Can anyone tell me how I can get client side values such as document.referrer, navigator.appName etc... into server side scripts? There are some client side values I'd like to set as session vars and insert into the db? How do I go about this? Thanks for any pointers Davlon PS (I'm using powersite 7.1.0.300) Pass them as page parameters, e.g., http://myserver/myurl?document.referrer=whatever&navigator.appName=yadayada Then, in your server-side script, just loop through the document.value array and get these values. -- pbm_hopethishelps, Roy Kie...

Storing the checked Htmlimputcheckbox values on client side and passing to server side on submit button clicked
Hi All  I've got these bunch of HtmlInputcheckboxes that i'm creating dynamically using div.innerhtml on server side and putting it in a <TD> block, calculate averages etc. Things are working fine until this point. Now i need to get all the checked checkboxes and their values(which are dates in my case) and pass these values back to server side for processing on the submit button click. But i'm using a pagefooter submit button to fire my submit button so i cannot directly pass these values to my submit button onclick method. I tried to use the findcontrol method ...

Client-side values to server-side ?
Hi! My previous query is attached below: I have implemented the below mentioned implementation . 'listbox1' on 'webform1' shows all the values from 'webform2'. I have implemented it using javascript. I would like to know that to implement validation on 'webform1', I would require the values of 'listbox1' ,which are on the client-side , to move to the server-side . I think sending a querystring will be fine but how to implement it using javascript and code-behind(C#)? Your suggestion will be appreciated. Thanks and regards, ap.       My previous query: " I am stuck wi...

Client Side values to Server Side
What is the best way to transfer Client Side values to the Server side? For example I have a variable "var1" in javascript. var1 = "sample"; How can I acquire this value in the server side?  What is the best approach for this?  Barry to send the value to the server during a postback, you need to place the value in an input control.  You could consider using a hidden textbox for that purpose.Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/ In the JavaScrip...

How to pass server side array to client side
Hello Friends.....   i want an intelligent textbox.....which pop up a list of data when any character is pressed in perticular textbox.......... the data should be related fields which are stored in database .........   for that i am having a javascript...........but it is static .....it has a static array and generates output..... but i want that particular with my own datafields.......   so please any one help me...... i will be very thank full........   Thanx and regards sandeep prajapatiBhaaratRemember to click "Mark as Answer" on the post t...

Passing variable between client side and server side
For example,how do I pass the return value of the confirm("whatever") to the server side? Or the opposite way.  I want to use a cookie to do is. Can some one give me hint.  Much appreciate your help.   Chen  Please "Mark as an Answer" if you think my post had helped you!Thanks. you can use ajax,javascript and cookies also.  Got what you needed. Please mark as answer. In the aspx file: <input type="hidden" id="confirmAnswer" name="confirmAnswer" runat="server"> That adds this to the...

Problem between client-side & server-side
I have two select controls (HtmlControl) here. They are set to runat='server'. I've bind some data to them when create. I also have a cliet side script to change them one's option to another using javascript. The question is how i can get items of theirs when they're posted back? The controls are like this: <SELECT language="jscript" id="LbFrom" ondblclick="return LbFrom_ondblclick()"multiple size="9" name="Select1" runat="server"> <option></option>'some option here .. .. .. </selec...

differences between server side asynchronous Web methods and client side asynchronous Web methods
Hi,   can anyone expalin what are the differences between server side asynchronous Web methods  and client side asynchronous Web methods in ASP.Net 2.0 ?   any best articles on serverside asynchronous Web methods  ?   Thanks,  hi, check this url, Server-Side Asynchronous Methods for ASP.NET, http://www.codeproject.com/KB/cpp/asyncws.aspx   Calling the Server-Side method asynchronously from Client Script, http://www.c-sharpcorner.com/UploadFile/dipenlama22/Callbacks07182006093320AM/Callbacks.aspx...

Firing both Client side event and server side event for server side button
I am having some difficulties getting this to work.. I have button_click (Asp.net) and ClientClick (Javascript).  Javascript is firing fine.  Server script is not. may be you have return return false in the in the javascript which is why its not firing server side event.You should add javascript evelt like thisbutton1.onclientclick = "functionname" Function should nopt return false. Vikram www.vikramlakhotia.comPlease mark the answer if it helped you...

Issue obtaining values in server-side from dropdownlist when updating value using client-side script in master page
HiI got a page in a contentplaceholder of a master page. There is two pulldowns. I populate the first one using server side coding and then use client-side javascript. So far so good. The issue is that upon a postback I try to collect the select value of the second pulldown and there is no data in the pulldown and no selected item. I tried using control.selectedvalue (nothing) or searching the form controls Stringvariable = oForm.FindControl("Control")Thing is I've done this before in 1.1 outside of a master page and it works.Thanks in ad...

How to pass a server side string variable to client side
Hi, In my application I want to send(or pass) a server side string variable to the client so that the client side javascript can operate on that string. I am new to ASP.NET. Can anyone please help me with some code snippets? If you allow a postback for this passing, you could store the string in a HiddenField and use javascript to read its value after a post~ If you want it to be more smooth and you are using asp.net 2.0, Script Callback is a good choice, there is a sample at the buttom of this page. Furthermore, some ajax framework will help you to call page method from client esa...

Web resources about - Problem passing value client-side to server-side - asp.net.web-forms

Client-side - Wikipedia, the free encyclopedia
Client-side refers to operations that are performed by the client in a client–server relationship in a computer network . Typically, a client ...

Senior Search Manager - Client Side!!
... strategy insight for senior IT management - resources to understand and leverage information technology. Senior Search Manager - Client Side ...

Account Manager - Client Side - Previous Agency Experience Welcome!!
Computerworld Australia is the leading source of technology news, analysis and tools for IT decision makers, managers and professionals.

Media Sales Executive - Client Side!!
Technology news and reviews for business and home.

PPC Paid Search Manager - CLIENT SIDE
Defining Technology for Australia's IT Leaders. PPC Paid Search Manager - SEM - **CLIENT SIDE** Sydney CBD Location Client side!! SEM/PPC/Paid ...

How Basecamp Next got to be so damn fast without using much client-side UI
When we started working on Basecamp Next last year, we had much internal debate about whether we should evolve the existing code base or rewrite ...

Seven Tips for Pitching From the Client's Side of the Table
I had a chance to sit on the other side of the pitch table. Here is what I learned.

Client-side coding: How to prevent malicious use?
Applications that run on a user-controlled device cannot be perfectly protected.

The client side
... regarding the professionals you seek to assist. Even better if you possess that understanding yourself, having worked on the client side. I'm ...

Ecommerce traffic being hijacked by client side malware
According to new research 15 to 30 percent of eCommerce site visitors are infected with Client Side Injected Malware (CSIM) that causes them ...

Resources last updated: 2/18/2016 4:35:58 AM