PDA

View Full Version : [CLOSED] Click on button - no postback



george
Sep 01, 2008, 3:17 PM
I have this simple piece of code below and what I want to achieve is to load my custom control inside the panel when I click the button but without refreshing the whole page (ie. postback). Can you instruct me how to do it?




<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="AJAXEnabledWebApplication2._Default" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
&amp;nbsp;
<ext:ScriptManager ID="ScriptManager1" runat="server">
</ext:ScriptManager>
<ext:Panel ID="Panel1" runat="server" Height="300" Title="Title">
</ext:Panel>
<ext:Button ID="Button1" runat="server" Text="Submit">
</ext:Button>



<br />
hello
</form>
</body>
</html>



Thanks.

geoffrey.mcgill
Sep 01, 2008, 4:03 PM
Hi george,

I'm not sure what you mean by "load my custom control"? I do not see a reference in your code sample to any custom controls.

Can you provide a full code sample demonstrating the scenario using a full postback? Then we should be able to recommend a solution to accomplish using an Ajax request. Although it might just involve using an <asp:UpdatePanel> as currently there's really no other supported method to dynamically load a control using an ajax request.

geoffrey.mcgill
Sep 07, 2008, 7:34 AM
Hi george,

I was just wondering if you found a solution to the problem. If yes, could you share the code for others?


If no, just post an updated code sample and we'll do our best to help out. 

george
Sep 08, 2008, 1:02 PM
Iframe was what I was looking for. Thanks for the fast reply.