and in code behind call PopupControlExtender1.DataBind()
Edit: 1: one thing you need to understand the '<%# Eval("description")%>'is
used to bind the value from datasource to controls. after binding if you want to read do like below
PopupControlExtender1.DynamicContextKey
Edit:2
: ver clearly we have explained if you are using PopupControlExtender
within gridview then you can use
If the description comes from a table you can use the select command to get the field. And the
anas’s post can also work. Why are you still in a strange way?
Pravind
Member
64 Points
230 Posts
Eval("field")
Apr 12, 2012 09:34 AM|LINK
Hi ,
My query is how to fetch the value of eval("field")in code behind.
<ajaxToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server" PopupControlID="Panel1" TargetControlID="Img1" DynamicContextKey='<%Eval("description")%>' DynamicControlID="Panel1" DynamicServiceMethod="GetContent" Position="Bottom"></ajaxToolkit:PopupControlExtender>
Now, how will i get the value of Eval("description") in code behind.Can any1 help on this?
anas
All-Star
73649 Points
7914 Posts
Moderator
Re: Eval("field")
Apr 12, 2012 09:49 AM|LINK
From where you want to read this value ? page_load ? click handler ? where are you placing this control ? inside grridview ?repeater ?
karthicks
All-Star
31334 Points
5414 Posts
Re: Eval("field")
Apr 12, 2012 09:50 AM|LINK
hi, if you are using inside databoud control then you can use '<%# Eval("description")%>'
else you can try like '<%= Eval("description")%>' (this can be used only with html controls)
or
<ajaxToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server" PopupControlID="Panel1" TargetControlID="Img1" DynamicContextKey='<%# Eval("description")%>' DynamicControlID="Panel1" DynamicServiceMethod="GetContent" Position="Bottom"></ajaxToolkit:PopupControlExtender>
and in code behind call PopupControlExtender1.DataBind()
Edit: 1: one thing you need to understand the '<%# Eval("description")%>'is used to bind the value from datasource to controls. after binding if you want to read do like below
PopupControlExtender1.DynamicContextKey
Edit:2 : ver clearly we have explained if you are using PopupControlExtender within gridview then you can use
DynamicContextKey='<%# Eval("description")%>'
Refer :http://www.c-sharpcorner.com/Blogs/8067/binding-ajax-popup-extender-with-database-value.aspx
http://www.dreamincode.net/forums/topic/251388-pop-up-control-extender-in-gridview/
http://yasserzaid.wordpress.com/2010/04/23/ajax-popupcontrol-extender-to-display-row-details-with-gridview/
Karthick S
Pravind
Member
64 Points
230 Posts
Re: Eval("field")
Apr 12, 2012 10:27 AM|LINK
string query = "SELECT FeatureDetails FROM featuremaster WHERE FeatureDetails ='" + contextKey + "'";
frontend:
<
ajaxToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server" PopupControlID="Panel1" TargetControlID="Img1" DynamicContextKey='<%Eval("description")%>' DynamicControlID="Panel1" DynamicServiceMethod="GetContent" Position="Bottom"></ajaxToolkit:PopupControlExtender>
Pravind
Member
64 Points
230 Posts
Re: Eval("field")
Apr 12, 2012 11:25 AM|LINK
Hi,
I just want this value of Eval("description") in code behind.How can i get this.
anas
All-Star
73649 Points
7914 Posts
Moderator
Re: Eval("field")
Apr 12, 2012 11:43 AM|LINK
If you are using that control inside GridView, you will need to specify the row index that you want to get the value from.
For example, to read the value from the first gridview row:
PopupControlExtender c=(PopupControlExtender )GridView1.Rows[0].FindControl("PopupControlExtender1");
string description=c.DynamicContextKey;
Pravind
Member
64 Points
230 Posts
Re: Eval("field")
Apr 13, 2012 04:18 AM|LINK
hi,
thanks for reply,
where do i need to write the above code,is it in rowbound or created of gridview?
Pravind
Member
64 Points
230 Posts
Re: Eval("field")
Apr 13, 2012 04:31 AM|LINK
Hi,
the problem is i am using that in a query like below.
string query = "SELECT FeatureDetails FROM featuremaster WHERE FeatureDetails ='" + contextKey + "'";
In front end ,
<ajaxToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server" PopupControlID="Panel1" TargetControlID="Img1" DynamicContextKey='<%= Eval("description")%>' DynamicServiceMethod="GetContent" DynamicControlID="Panel1" Position="Bottom"></ajaxToolkit:PopupControlExtender>
in dynamiccontextkey iam passing the fiels <%= Eval("description")%>,but iam not able to get that Eval value.
Can any1 help on this?
Richey
Contributor
3816 Points
431 Posts
Re: Eval("field")
Apr 18, 2012 10:25 AM|LINK
Hi,
If the description comes from a table you can use the select command to get the field. And the anas’s post can also work. Why are you still in a strange way?