Showing posts with label linkbutton. Show all posts
Showing posts with label linkbutton. Show all posts

Wednesday, March 28, 2012

Content disapears on update of updatepanel inside of another updatepanel! Plz help.

Hi i have a problem, i have a UpdatePanel(UpdatePanel3) with a Panel(contentPanel)inside after clicking on the LinkButton(homeLinkButton)I add a Control(home.ascx) to Panel(contentPanel) in that control i have another UpdatePanel(homeUpdatePanel) and a Button(Button1), when i click on that button the whole content of Panel(contenPanel) disapears, how do i solve it and get a update of the dynamicly added UpdatePanel(homeUpdatePanel) inside of Panel(contentPanel)?

Default.aspx

1<form id="form1" runat="server">2 <asp:ScriptManager ID="ScriptManager1" runat="server" />3 <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">4 <ContentTemplate>5 <table style="width: 584px; height: 248px">6 <tr>7 <td style="width: 162px; height: 175px" valign="top">8 <asp:LinkButton ID="homeLinkButton" runat="server" OnClick="homeLinkButton_Click">Home</asp:LinkButton><br />9 <asp:LinkButton ID="uploadLinkButton" runat="server" OnClick="LinkButton3_Click">Upload</asp:LinkButton>10 <br />11 <asp:LinkButton ID="zoekenLinkButton" runat="server">Zoeken</asp:LinkButton></td>12 <td rowspan="2" valign="top">13 <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">14 <ContentTemplate>15 <asp:Panel ID="contentPanel" runat="server" Height="184px" Width="392px">16  </asp:Panel>17 </ContentTemplate>18 <Triggers>19 <asp:AsyncPostBackTrigger ControlID="homeLinkButton" />20 </Triggers>21 </asp:UpdatePanel>22 </td>23 </tr>24 <tr>25 <td style="width: 162px">26 </td>27 </tr>28 </table>29 </ContentTemplate>30 </asp:UpdatePanel>31 </form>
Default.aspx.vb
12Protected Sub homeLinkButton_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)3Dim clAs Control4 cl = LoadControl("home.ascx")5 contentPanel.Controls.Add(cl)6 UpdatePanel3.Update()7End Sub8
home.ascx
1<%@dotnet.itags.org. Control Language="VB" AutoEventWireup="false" CodeFile="home.ascx.vb" Inherits="home" %>2Dit is dan onze Home pagina die dymanisch wordt opgeladen.<br />3Pagina was geladen op4<asp:Label ID="pageLoadLabel" runat="server"></asp:Label><br />5<asp:UpdatePanel ID="homeUpdatePanel" runat="server" UpdateMode="Conditional">6 <ContentTemplate>7<asp:Label ID="timeLabel" runat="server"></asp:Label>8 </ContentTemplate>9 <Triggers>10 <asp:AsyncPostBackTrigger ControlID="Button1" />11 </Triggers>12</asp:UpdatePanel>13<asp:Button ID="Button1" runat="server" Text="Button" Width="160px" />
home.ascx.vb
1Protected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.Load2 timeLabel.Text = DateTime.Now3 pageLoadLabel.Text = DateTime.Now4End Sub56 Protected Sub Button1_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Button1.Click7 timeLabel.Text = DateTime.Now8End Sub
Thx, Me

Hi,

Thank you for your post!

I think this is a known issue,It is something about Dynamicaly loading User Controls into UpdatePanel.

You can see the following threads too:

http://forums.asp.net/p/1156704/1906671.aspx#1906671

http://forums.asp.net/t/1108394.aspx

If you have further questions,let me know.

Best Regards,

Monday, March 26, 2012

ConfirmButtonExtender with GridView

I have a LinkButton in a gridview that acts as a select, and I was hoping to use the ConfirmButtonExtender. I tried it in the ItemTemplate for that column, but it gave me an error that it can't find a control with the ID. Is there any way to use that with a button in a gridview? If so, where does the extender need to be?I think you can just drop the extender in the template, but if that doesn't work, I believe this has been covered elsewhere on this forum. Once the search feature is working again it shouldn't be too difficult to find, I hope.
I ended up using a javascript confirm box this time, but I will probably look into it again next time I need to.

Hey medenn, can you share your code? thanksSmile


OnClientClick="javascript:void_confirm=confirm('Message Here');return void_confirm;"

ConfirmButton and GridView LinkButtons

Hi Everyone,

I would like to use the ConfirmButtonExtender when a LinkButton in a DataGrid control is clicked. The LinkButton is a TemplateColumn in the DataGrid control. I have the DataGrid in an UpdatePanel, along with the ConfirmButtonExtender control. However, the LinkButton is not visible to the ConfirmButton control when trying to set the TargetControlID property.

Is it possible to tie the ConfirmButtonExtender to a control in a DataGrid?

Hey,

You would also have to put the ConfirmButtonExtender in the template column with the linkbutton.

Wednesday, March 21, 2012

Composite Control with AsyncPostBack problem

Hello,

i have created a composite control ( imagebutton and linkbutton) with couple of properties etc... everything is working fine!

am using ajax also , but when i click on the imagebutton from that composite control an asyncpostback is called while if i click on linkbutton i get a normal postback ! weird!

anyone has an idea on this?

thank you its urgent

part of the composit control !

imagebtn =newImageButton();

imagebtn.ImageAlign =ImageAlign.AbsMiddle;

if (!isInabled)

{

imagebtn.Enabled =false;

}

imagebtn.CommandName ="Click";if (isDD.Equals("True"))

{

imagebtn.ID ="Anchor";

}

Controls.Add(imagebtn);

Controls.Add(newLiteralControl(" "));if (imagebtnAlign.Equals("top"))

{

Controls.Add(newLiteralControl("<br>"));

}

button =newLinkButton();

if (!isInabled)

{

button.Enabled =false;

}

button.CssClass = textCssName;

button.CommandName ="Click";

Controls.Add(button);


Hi,

Please try to force a postback with the following code:

button =newLinkButton();

if (!isInabled)

{

button.Enabled =false;

}

button.CssClass = textCssName;

button.CommandName ="Click";

button.Attributes.Add("onclick", "__doPostBack('" + button.ClientID + "','');");

Hope this helps.