Showing posts with label links. Show all posts
Showing posts with label links. Show all posts

Monday, March 26, 2012

Pass values from URL to other pages ?

i have a page A and Page B.
in Page A have 2 links to Page B. to display a set of date based on
condiction set in url.. like
in page A
link1 = pageB.aspx?id=1
link2 = pageB.aspx?id=2
so when page B opens it sould get the values from the url and run a queary..
like
SELECT * FROM TABEL WHERE KEY_ID= (value got some page A)
in page B i have a Dataview bind with 'SqlDataSource' i exactly dont know to
call the valus from URL...
your thoughs much appericated !Hi ,
You can get value from Url by using Request.Querystring["id"].
Thanks
Sharmila
You can use the QueryString property of the Request: Request.QueryString["id
"].
See
[url]http://authors.aspalliance.com/aspxtreme/sys/web/httprequestclassquerystring.aspx[
/url]
Hege Servold
hege.servold(AT)bekk.no
"velu" wrote:

> i have a page A and Page B.
> in Page A have 2 links to Page B. to display a set of date based on
> condiction set in url.. like
> in page A
> link1 = pageB.aspx?id=1
> link2 = pageB.aspx?id=2
> so when page B opens it sould get the values from the url and run a queary
.
> like
> SELECT * FROM TABEL WHERE KEY_ID= (value got some page A)
> in page B i have a Dataview bind with 'SqlDataSource' i exactly dont know
to
> call the valus from URL...
> your thoughs much appericated !

Pass values from URL to other pages ?

i have a page A and Page B.

in Page A have 2 links to Page B. to display a set of date based on
condiction set in url.. like

in page A

link1 = pageB.aspx?id=1
link2 = pageB.aspx?id=2

so when page B opens it sould get the values from the url and run a queary..

like

SELECT * FROM TABEL WHERE KEY_ID= (value got some page A)

in page B i have a Dataview bind with 'SqlDataSource' i exactly dont know to
call the valus from URL...

your thoughs much appericated !Hi ,

You can get value from Url by using Request.Querystring["id"].

Thanks
Sharmila
You can use the QueryString property of the Request: Request.QueryString["id"].
See
http://authors.aspalliance.com/aspx...uerystring.aspx

--
Hege Servold
hege.servold(AT)bekk.no

"velu" wrote:

> i have a page A and Page B.
> in Page A have 2 links to Page B. to display a set of date based on
> condiction set in url.. like
> in page A
> link1 = pageB.aspx?id=1
> link2 = pageB.aspx?id=2
> so when page B opens it sould get the values from the url and run a queary..
> like
> SELECT * FROM TABEL WHERE KEY_ID= (value got some page A)
> in page B i have a Dataview bind with 'SqlDataSource' i exactly dont know to
> call the valus from URL...
> your thoughs much appericated !

Saturday, March 24, 2012

pass vaules between user control (ascx) and aspx page?

Any one have examples or links of how to pass vaules between user control (ascx) and aspx page?

I've been able to pass a value from an aspx page to a user control called in it by adding the variable name = "somevalue" inside the user control tag.

But now I want to have a value from a user control's textbox after a button is clicked, availble to the aspx page.

This seems so simple... and yet I am so lost :)Hi,

In the user Control you can make public properties that will return the string writtin in the TextBox of User Control.

And then in the webform.apsx page you can make an instance of the UserControl and use that property to get the value which is returned from the TextBox.
Thank you!

I did a search on google for those terms and found this article ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconexposingpageletproperties.asp ), and it looks like it goes into detail on public properties of a user control.

Thanks. :)
Am I missing something?
Can the user control properties only be changed from the page that calls the user control, is it possible the other way around, so that in the user control the properties are changed and the page that calls the uc can access those? Two way street or only one way? :)