Thursday, March 29, 2012
Pass Paramter from Repeater - Can't Figure This Out
I have a repeater based on a stored procedure. It pulls the following:
catDesc Image
The user sees the category description (catDesc) , and then clicks on
the image (Image) which is bound to the catID. This catID (@dotnet.itags.org.catID --
an integer) is then to be passed to the next page, sculpture2.aspx for
use in a datagrid with a stored procedure.
I understand how to pass a parameter using response.redirect. I've
done so with a dropdownlist in the past by using OnSelectedIndexChanged
and just using dropdownlist.selecteditem.value as the parameter (an
integer in this case) which I use with response.redirect.
Is there an equivalent techinque for using a repeater?
Here is my code:
<asp:repeater runat="server" ID=repeaterOdd>
<itemtemplate>
<p align="left"><%#DataBinder.Eval(Container.DataItem,
"catDesc") %></p>
<p align="left">
<a href="http://links.10026.com/?link=sculpture2.aspx?catDesc=<%#DataBinder.Eval(Container.DataItem,
"catID")%>"
<img src="http://pics.10026.com/?src=<%# DataBinder.Eval(Container.DataItem, "image") %>"></p>
</itemtemplate>
</asp:repeater>
If I pass this parameter as CatID, then I can't retrieve it using a
querysting, and the whole goal is to use a querystring to pass the
parameter. (e.g int passedValue = Request.Querystring["catID"].
Is there some way to pull the selected value of catID out of the
repeater, put it in some kind of variable, and then run a method to
attach it to a response.redirect?
Is there another way to do this? Using a LinkButton?
Thanks in advance.you can replace the image tag with an asp:HyperLink that way the user can
click on the image and be redirected to a page with your catID accesible
thus:
<asp:HyperLink id="HyperLink1" runat="server" ImageUrl="<%#
DataBinder.Eval(Container.DataItem, "image") %>"
NavigateUrl=secondpage.aspx?caiID=<%#DataBinder.Eval(Container.DataItem,
"catID")%>"></asp:HyperLink>
"Ranginald" <davidwank@.gmail.com> wrote in message
news:1146692474.566945.201390@.y43g2000cwc.googlegroups.com...
> Hi,
> I have a repeater based on a stored procedure. It pulls the following:
> catDesc Image
> The user sees the category description (catDesc) , and then clicks on
> the image (Image) which is bound to the catID. This catID (@.catID --
> an integer) is then to be passed to the next page, sculpture2.aspx for
> use in a datagrid with a stored procedure.
> I understand how to pass a parameter using response.redirect. I've
> done so with a dropdownlist in the past by using OnSelectedIndexChanged
> and just using dropdownlist.selecteditem.value as the parameter (an
> integer in this case) which I use with response.redirect.
> Is there an equivalent techinque for using a repeater?
> Here is my code:
> <asp:repeater runat="server" ID=repeaterOdd>
> <itemtemplate>
> <p align="left"><%#DataBinder.Eval(Container.DataItem,
> "catDesc") %></p>
> <p align="left">
> <a href="http://links.10026.com/?link=sculpture2.aspx?catDesc=<%#DataBinder.Eval(Container.DataItem,
> "catID")%>"
> <img src="http://pics.10026.com/?src=<%# DataBinder.Eval(Container.DataItem, "image") %>"></p>
> </itemtemplate>
> </asp:repeater>
> If I pass this parameter as CatID, then I can't retrieve it using a
> querysting, and the whole goal is to use a querystring to pass the
> parameter. (e.g int passedValue = Request.Querystring["catID"].
> Is there some way to pull the selected value of catID out of the
> repeater, put it in some kind of variable, and then run a method to
> attach it to a response.redirect?
> Is there another way to do this? Using a LinkButton?
> Thanks in advance.
>
Thanks for your response. How would I then pull the value?
Still with respons.querystring?
Thanks again.
Pass Paramter from Repeater - Cant Figure This Out
I have a repeater based on a stored procedure. It pulls the following:
catDesc Image
The user sees the category description (catDesc) , and then clicks on
the image (Image) which is bound to the catID. This catID (@dotnet.itags.org.catID --
an integer) is then to be passed to the next page, sculpture2.aspx for
use in a datagrid with a stored procedure.
I understand how to pass a parameter using response.redirect. I've
done so with a dropdownlist in the past by using OnSelectedIndexChanged
and just using dropdownlist.selecteditem.value as the parameter (an
integer in this case) which I use with response.redirect.
Is there an equivalent techinque for using a repeater?
Here is my code:
<asp:repeater runat="server" ID=repeaterOdd>
<itemtemplate>
<p align="left"><%#DataBinder.Eval(Container.DataItem,
"catDesc") %></p>
<p align="left">
<a href="http://links.10026.com/?link=sculpture2.aspx?catDesc=<%#DataBinder.Eval(Container.DataItem,
"catID")%>"
<img src="http://pics.10026.com/?src=<%# DataBinder.Eval(Container.DataItem, "image") %>"></p>
</itemtemplate>
</asp:repeater
If I pass this parameter as CatID, then I can't retrieve it using a
querysting, and the whole goal is to use a querystring to pass the
parameter. (e.g int passedValue = Request.Querystring["catID"].
Is there some way to pull the selected value of catID out of the
repeater, put it in some kind of variable, and then run a method to
attach it to a response.redirect?
Is there another way to do this? Using a LinkButton?
Thanks in advance.you can replace the image tag with an asp:HyperLink that way the user can
click on the image and be redirected to a page with your catID accesible
thus:
<asp:HyperLink id="HyperLink1" runat="server" ImageUrl="<%#
DataBinder.Eval(Container.DataItem, "image") %>"
NavigateUrl=secondpage.aspx?caiID=<%#DataBinder.Eval(Container.DataItem,
"catID")%>"></asp:HyperLink
"Ranginald" <davidwank@.gmail.com> wrote in message
news:1146692474.566945.201390@.y43g2000cwc.googlegr oups.com...
> Hi,
> I have a repeater based on a stored procedure. It pulls the following:
> catDesc Image
> The user sees the category description (catDesc) , and then clicks on
> the image (Image) which is bound to the catID. This catID (@.catID --
> an integer) is then to be passed to the next page, sculpture2.aspx for
> use in a datagrid with a stored procedure.
> I understand how to pass a parameter using response.redirect. I've
> done so with a dropdownlist in the past by using OnSelectedIndexChanged
> and just using dropdownlist.selecteditem.value as the parameter (an
> integer in this case) which I use with response.redirect.
> Is there an equivalent techinque for using a repeater?
> Here is my code:
> <asp:repeater runat="server" ID=repeaterOdd>
> <itemtemplate>
> <p align="left"><%#DataBinder.Eval(Container.DataItem,
> "catDesc") %></p>
> <p align="left">
> <a href="http://links.10026.com/?link=sculpture2.aspx?catDesc=<%#DataBinder.Eval(Container.DataItem,
> "catID")%>"
> <img src="http://pics.10026.com/?src=<%# DataBinder.Eval(Container.DataItem, "image") %>"></p>
> </itemtemplate>
> </asp:repeater>
> If I pass this parameter as CatID, then I can't retrieve it using a
> querysting, and the whole goal is to use a querystring to pass the
> parameter. (e.g int passedValue = Request.Querystring["catID"].
> Is there some way to pull the selected value of catID out of the
> repeater, put it in some kind of variable, and then run a method to
> attach it to a response.redirect?
> Is there another way to do this? Using a LinkButton?
> Thanks in advance.
Thanks for your response. How would I then pull the value?
Still with respons.querystring?
Thanks again.
Monday, March 26, 2012
Pass values from URL to other pages ?
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 ?
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
passing a collection to a function
I have finised the inbox, read, delete email etc..
Im in the process of making the "create email" or compose...
What the plan is, for people to be able to enter multiple "To:" "CC:" and "BCC:"
I have only done the "To:" field as yes, Atrax gave me the hint on how to split the emails with a ";" using split
What that did thou was place the emails into an array, which made it a pain to remove any blank emails which would cause an error...
I would always be working with strings, Below is the code that works with the "To" field
Dim arrTo(), strEmail As String
Dim j, intColCount, intEmptyColID As Integer
Dim colTo As ArrayList
Dim bolValidEmails, bolFoundInvalid As Boolean
'Dim objMsg As Object
'objMsg = Server.CreateOBject("JMail.Message")
'objMsg.Logging = true
'objMsg.Silent = true
'objMsg.From = Session("EmailAddress")
'\\\\\\\\\\\\\\\Splits the "To:" information into different emails - placing them into a collection for later use
colTo = New ArrayList
arrTo = strTo.Split(";")
For Each strEmail in arrTo
colTo.Add(trim(strEmail))
Next
'\\\\\\\\\\\\\\\Erases any empty emails out of the collection
bolValidEmails = False
bolFoundInvalid = False
intEmptyColID = -1
Do While bolValidEmails = False
For j = 0 To colTo.Count - 1
If bolFoundInvalid = False Then
If colTo(j) = "" Then
bolFoundInvalid = True
intEmptyColID = j
End If
End If
Next
If bolFoundInvalid = True Then
bolValidEmails = False
colTo.RemoveAt(intEmptyColID)
Else
bolValidEmails = True
End If
intEmptyColID = -1
bolFoundInvalid = False
Loop
'\\\\\\\\\\\\\\\Trims the Collection
colTo.TrimToSize()
What I want to do is, after I create the collection for any of the "to" "cc" and "bcc" is call that function and empty any blank emails, but I dont know how to pass the collection to the function and return the collection and continue on...
I was only using the
Dim strRandom As String
Dim objRand As New Misc
strRandom = objRand.GenerateRandNum()
objRand = Nothing
Response.Redirect("inbox.aspx?rnd=" & strRandom)
as an example of what i wanted to do as i couldn't remember the name after so many hours of programming =)...
I was asking can i use something like
Dim objChecker As New Misc
objRand.GenerateRandNum(ByRef collection name as ??)
objRand = Nothing
'continue with the rest of the email processing
do you have any code that passes a collection to a function like that? That I can look at, As I will need to be able to use the same function by multiple classes..(eg on the "reply", "Create email", "forward" class etc )
Thanks heaps
Hawk
ws abyss at infoyou can use a function with a parametere of collection as
1- dimension
private function myfunction(ByVal Arrto() As String)
or
private function myfunction(ByVal Arrto As String())
2- dimension
private function myfunction(ByVal Arrto(,) As String)
or
private function myfunction(ByVal Arrto As String(,))
Regards
Ather Ali Shaikh
"Hawk" <anonymous@.discussions.microsoft.com> wrote in message
news:13B899D4-3698-4E51-AC58-5FBE388D9C75@.microsoft.com...
> What I am doing is creating a web based email, using .net
> I have finised the inbox, read, delete email etc..
> Im in the process of making the "create email" or compose...
> What the plan is, for people to be able to enter multiple "To:" "CC:" and
"BCC:"
> I have only done the "To:" field as yes, Atrax gave me the hint on how to
split the emails with a ";" using split
> What that did thou was place the emails into an array, which made it a
pain to remove any blank emails which would cause an error...
> I would always be working with strings, Below is the code that works with
the "To" field
>
> Dim arrTo(), strEmail As String
> Dim j, intColCount, intEmptyColID As Integer
> Dim colTo As ArrayList
> Dim bolValidEmails, bolFoundInvalid As Boolean
> 'Dim objMsg As Object
> 'objMsg = Server.CreateOBject("JMail.Message")
> 'objMsg.Logging = true
> 'objMsg.Silent = true
> 'objMsg.From = Session("EmailAddress")
> '\\\\\\\\\\\\\\\Splits the "To:" information into different
emails - placing them into a collection for later use
> colTo = New ArrayList
> arrTo = strTo.Split(";")
> For Each strEmail in arrTo
> colTo.Add(trim(strEmail))
> Next
> '\\\\\\\\\\\\\\\Erases any empty emails out of the collection
> bolValidEmails = False
> bolFoundInvalid = False
> intEmptyColID = -1
> Do While bolValidEmails = False
> For j = 0 To colTo.Count - 1
> If bolFoundInvalid = False Then
> If colTo(j) = "" Then
> bolFoundInvalid = True
> intEmptyColID = j
> End If
> End If
> Next
> If bolFoundInvalid = True Then
> bolValidEmails = False
> colTo.RemoveAt(intEmptyColID)
> Else
> bolValidEmails = True
> End If
> intEmptyColID = -1
> bolFoundInvalid = False
> Loop
> '\\\\\\\\\\\\\\\Trims the Collection
> colTo.TrimToSize()
>
> What I want to do is, after I create the collection for any of the "to"
"cc" and "bcc" is call that function and empty any blank emails, but I dont
know how to pass the collection to the function and return the collection
and continue on...
> I was only using the
> Dim strRandom As String
> Dim objRand As New Misc
> strRandom = objRand.GenerateRandNum()
> objRand = Nothing
> Response.Redirect("inbox.aspx?rnd=" & strRandom)
> as an example of what i wanted to do as i couldn't remember the name after
so many hours of programming =)...
> I was asking can i use something like
> Dim objChecker As New Misc
> objRand.GenerateRandNum(ByRef collection name as ??)
> objRand = Nothing
> 'continue with the rest of the email processing
>
> do you have any code that passes a collection to a function like that?
That I can look at, As I will need to be able to use the same function by
multiple classes..(eg on the "reply", "Create email", "forward" class etc )
> Thanks heaps
> Hawk
> ws abyss at info