Thursday, March 29, 2012

Passing values from client 2 server

Hi,

Simple question:

Is there a way to a value from client-side to server-side upon a click?

function _getReport(ReportName) { alert(ReportName); }

<asp:datalist id="dlReports" runat="server">
<itemtemplate>
<img height="7" src="http://pics.10026.com/?src=../ReportsImages/navlink.gif" width="5">
<a class="Normal" id="<%#
DataBinder.Eval(Container.DataItem,"Description") %>"
href="ReportMainPage.aspx" onclick="return _getReport('<%#
EncryptString(DataBinder.Eval(Container.DataItem,"Description"))%>');">
<%# DataBinder.Eval(Container.DataItem,"Description") %></a>
</itemtemplate>
</asp:datalist
What I would like to accomplish is to pass the report name to server-side
from client-side upon clicking on a link above.

YamaSomething like, create a hyperlink column in a DataSet and capture the value
sent when the person clicks? There are a variety of other controls,
LinkButton, et al, you can use, as well. Repeater is often better, as you
have more flexibility, but it really depends on what you need.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Yama" <ykamyar@.grandpacificresorts.com> wrote in message
news:ePgR80%230DHA.1740@.TK2MSFTNGP12.phx.gbl...
> Hi,
> Simple question:
> Is there a way to a value from client-side to server-side upon a click?
> function _getReport(ReportName) { alert(ReportName); }
> <asp:datalist id="dlReports" runat="server">
> <itemtemplate>
> <img height="7" src="http://pics.10026.com/?src=../ReportsImages/navlink.gif" width="5">
> <a class="Normal" id="<%#
> DataBinder.Eval(Container.DataItem,"Description") %>"
> href="http://links.10026.com/?link=ReportMainPage.aspx" onclick="return _getReport('<%#
> EncryptString(DataBinder.Eval(Container.DataItem,"Description"))%>');">
> <%# DataBinder.Eval(Container.DataItem,"Description") %></a>
> </itemtemplate>
> </asp:datalist>
> What I would like to accomplish is to pass the report name to server-side
> from client-side upon clicking on a link above.
> Yama
Hi Greg,

Thank you for your reponse. I would like, once the list is generated, to
capture the (<%# DataBinder.Eval(Container.DataItem,"Description") %>)
report name every time the user clicks on a link.

How can I do that using LinkButton?

Yama

"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@.comcast.netNoSpamM> wrote in
message news:Ouy2l6%230DHA.832@.TK2MSFTNGP09.phx.gbl...
> Something like, create a hyperlink column in a DataSet and capture the
value
> sent when the person clicks? There are a variety of other controls,
> LinkButton, et al, you can use, as well. Repeater is often better, as you
> have more flexibility, but it really depends on what you need.
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> ************************************************** ********************
> Think Outside the Box!
> ************************************************** ********************
> "Yama" <ykamyar@.grandpacificresorts.com> wrote in message
> news:ePgR80%230DHA.1740@.TK2MSFTNGP12.phx.gbl...
> > Hi,
> > Simple question:
> > Is there a way to a value from client-side to server-side upon a click?
> > function _getReport(ReportName) { alert(ReportName); }
> > <asp:datalist id="dlReports" runat="server">
> > <itemtemplate>
> > <img height="7" src="http://pics.10026.com/?src=../ReportsImages/navlink.gif" width="5">
> > <a class="Normal" id="<%#
> > DataBinder.Eval(Container.DataItem,"Description") %>"
> > href="http://links.10026.com/?link=ReportMainPage.aspx" onclick="return _getReport('<%#
> > EncryptString(DataBinder.Eval(Container.DataItem,"Description"))%>');">
> > <%# DataBinder.Eval(Container.DataItem,"Description") %></a>
> > </itemtemplate>
> > </asp:datalist>
> > What I would like to accomplish is to pass the report name to
server-side
> > from client-side upon clicking on a link above.
> > Yama

0 comments:

Post a Comment