473,395 Members | 1,797 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,395 software developers and data experts.

pass a value to same page on clicking a button in asp.net

11
Hi

i'm new to asp .. and .net environment.. the task is on clicking a button i want the same page to be posted back with an additional flag variable..and then i want to check this variable and based on it i have to follow a different path

so i tried in the onclick event of the image button to call the same page

e.g default.aspx?'&flagvalue=1'

and in the codebehind on page load event if i try to get the value

using request.querystring , it always seems to be null ami missing something here

or is there any better way than this


thanks in advance
Aug 6 '07 #1
5 1759
prabunewindia
199 100+
hi friend,
give the exact code u used to pass value thru query string and to get the value

Prabu


Hi

i'm new to asp .. and .net environment.. the task is on clicking a button i want the same page to be posted back with an additional flag variable..and then i want to check this variable and based on it i have to follow a different path

so i tried in the onclick event of the image button to call the same page

e.g default.aspx?'&flagvalue=1'

and in the codebehind on page load event if i try to get the value

using request.querystring , it always seems to be null ami missing something here

or is there any better way than this


thanks in advance
Aug 7 '07 #2
priravi
11
hi friend,
give the exact code u used to pass value thru query string and to get the value

Prabu
hi

<input type=hidden id="favouriteflag" value ="">

<td border=0>
<input type="image" align ="absbottom" src="images/favourite.gif" alt="My favourites" border=0 style="cursor:hand;" onclick=" 'cb_datalist.aspx?Title=Concept Bank&amp;profile=' +'<%=Session["s_repositoryId"]%>'+ '&amp;workspaceid='+workspace + '&amp;parentid=0'+ '&amp;favouriteflag=1'" >
</td>


and in the code behind in pageload event,i gave
if(Request.QueryString["favouriteflag"]!=null)
{
Session["favflag"]= Request.QueryString["favouriteflag"];

}
Aug 7 '07 #3
I just want to show the text before of paging, is there any property to set the text before the page index.
Aug 7 '07 #4
prabunewindia
199 100+
hi friend,
i think there is a space between Concept and Bank
remove the space and try

Prabu

hi

<input type=hidden id="favouriteflag" value ="">

<td border=0>
<input type="image" align ="absbottom" src="images/favourite.gif" alt="My favourites" border=0 style="cursor:hand;" onclick=" 'cb_datalist.aspx?Title=Concept Bank&amp;profile=' +'<%=Session["s_repositoryId"]%>'+ '&amp;workspaceid='+workspace + '&amp;parentid=0'+ '&amp;favouriteflag=1'" >
</td>


and in the code behind in pageload event,i gave
if(Request.QueryString["favouriteflag"]!=null)
{
Session["favflag"]= Request.QueryString["favouriteflag"];

}
Aug 8 '07 #5
kenobewan
4,871 Expert 4TB
You could do some of the above or you could find the values in a simple onclick. HTH.
Aug 8 '07 #6

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

Similar topics

2
by: Matt | last post by:
How to pass data back and forth between ASP and JSP page? Let's say I have Java objects, how to pass the data back to ASP page?? Or ASP has data, how to pass the data to JSP page?? Please...
4
by: Fred | last post by:
Hi, i know how to pass a value from Javascript to ASP with a hidden field into a form and submitting it, or with cookies, but here i have to pass a lot of data in an array. There is a list of...
1
by: Al | last post by:
Ref:how to pass value along with click of a button hi,I have created a form that has single button. as follow <asp:button id="btnCallfunction" runat="server" text="func_call" onclick="add_int" />...
2
by: Joey | last post by:
Hi There, I am trying to get the selected value of a listbox when I click a button, everything works ok and I can bind the list and when I have a basic page and click a button to invoke a sub it...
6
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to...
3
by: Sharon | last post by:
hello all, I was successfull in passing one value from first webpage to second webpage, but not sure how to pass three textbox values from the first page to the second page. Below is the code i...
1
by: colleen1980 | last post by:
Hi: Can any one please tell me that how to i pass the two textbox values in the new page. If i use the form action in the popup window page then the new page is open in the same popup window as i...
24
by: =?Utf-8?B?U3dhcHB5?= | last post by:
Can anyone suggest me to pass more parameters other than two parameter for events like the following? Event: Onbutton_click(object sender, EventArgs e)" Event handler: button.Click += new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.