Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Saturday, March 24, 2012

AJAX and web server controls

Please some one explain me the following in ajax.

1) Is it necessary that I have to use html controls instead of web server control in order to support AJAX in my web page?. (I know we can use Magic AJAX – penal control to do the same. But I don't want to use any third party component or library).

2) As per my understanding in AJAX like technology I can send some information to the server and I can get some info from the server based on the info sent. But if I want to add a new row to my web server datagrid control. How can we do this with AJAX. I mean if I add a blank row to my collection class then how will I reflect that in UI.

3) Is there any simple code sample available in the net that demonstrates the web server control manipulation with AJAX.

Hi,

you can use normal web controls when you use Atlas, which is the AJAX implementation/framework from Microsoft.

For more information and quickstartsplease take a look here.

Grz, Kris.

Ajax and Web custom Control

Hi all ,

Can any budy tell the approach for building a treeview web custom control using ajax

I cant getting the idea of rendring the tree view(HTML for Tree view ie using ajax)

Any help

Hi

Have you tried nested Datalists?

Thanks


No Jin

Nerver Header give some hint...

Another thing ,i start to build the tree using ul and li of html tag and rendering in the following manner

protected void BuildDivContainingTree(HtmlTextWriter output)
{

// Start building the HTML
output.Write("<div><ul><li>");
output.Write("<table><tr><td><IMG src='../../images/minus.gif'></td><td style='cursor:hand' onclick='onTextClicked(0,0);'>");
output.Write("<font color=red>");
output.Write(this.BaseNodeText + "</font></td></tr></table>");
output.Write("<div id='treeview_0'></div><div id='DivInPage'></div>");
output.Write("</li></ui>");

output.Write("<script>document.onreadystatechange=StartLoading('" + this.Type + "')</script>");

}

now i want to send a ajax cal for filling the node of the tree...

what should i do ?

as i created in the custom control i send a request to a aspx page and execute server function and place the out as response text as xml dox and render it in <li> inner text .

any suggestions

Ajax and MasterPage issues (tags like scriptManager and html - not recognized)

I am having problem with AJAX Toolkit and MasterPages.

When I create a new Content Page and use html tags or ahax scriptManager I recevied lots of errors.

I cannot seem to get this resolved.

Here find below example I am working on - none of the html or scriptManager stuff for ajax is being recongnised.

Please assist.

File Sample

------------

<%@dotnet.itags.org.PageLanguage="C#"MasterPageFile="~/MasterPage.master"AutoEventWireup="true"CodeFile="laz.aspx.cs"Inherits="laz"Title="Untitled Page" %>

<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">

</asp:Content>

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

<scriptrunat="server">

protectedvoid btnRefresh_Click(object sender,EventArgs e)

{

}

</script>

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headid="Head1"runat="server">

<title>Untitled Page</title>

<linkhref="StyleSheet.css"rel="stylesheet"type="text/css"/>

</head>

<body>

<formid="form1"runat="server">

<asp:ScriptManagerID="ScriptManager1"runat="server">

</asp:ScriptManager>

<asp:PanelID="Panel1"runat="server"CssClass="modalPopup"Height="50px"Width="235px"style="display:none"DefaultButton="btnOk">

<asp:UpdatePanelID="UpdatePanel1"runat="server"UpdateMode="Conditional">

<ContentTemplate>

<%=DateTime.Now.ToString() %>

<divstyle="display:none">

<asp:ButtonID="btnRefresh"runat="server"Text="Refresh"OnClick="btnRefresh_Click"/>

</div>

</ContentTemplate>

</asp:UpdatePanel>

<asp:ButtonID="btnCancel"runat="server"Text="Cancel"/>

<asp:ButtonID="btnOk"runat="server"Text=" OK "/>

</asp:Panel>

<asp:ButtonID="Button2"runat="server"Text="Button"Enabled="false"style="display:none"/>

<ajaxToolkit:ModalPopupExtenderID="ModalPopupExtender1"runat="server"TargetControlID="Button2"PopupControlID="Panel1"CancelControlID="btnCancel"DropShadow="true"BackgroundCssClass="modalBackground">

</ajaxToolkit:ModalPopupExtender>

<inputid="Button3"type="button"value="Click Me"onclick="showModalPopup()"/>

<scripttype="text/javascript"language="javascript">

function showModalPopup(){

$get("<%=btnRefresh.ClientID %>").click();

$find("<%= this.ModalPopupExtender1.ClientID %>").show();

}

</script>

</form>

</body>

</html>

...........?

why are all the tags outside the <asp:Content? Aren't they suppose to be inside?


Honestly is does not matter if the content is inside the ASP tag or not. I was testing the contents outside. Here find the same results with ASP tag and content inside.

With the below I receive 7 errors

1. Only content controls allowed directly in content page. LINE 16

2. Validation XHTML 1.0 Element body cannot be in nested within <div> - I do not have div tag in ths aspx page but maybe it comes from the masterpage? LINE 14

3. Element Script Manager not a knwon element LINE 16

4. Element UpdatePanel unknown element LINE 19

5. Validation Element contenttemplate is not supported LINE 20

6. Element Button is not a known element Line 23

<%@.PageLanguage="C#"MasterPageFile="~/MasterPage.master"AutoEventWireup="true"CodeFile="laz.aspx.cs"Inherits="laz"Title="Untitled Page" %>

<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">

<scriptrunat="server">

protectedvoid btnRefresh_Click(object sender,EventArgs e)

{

}

</script>

<body> LINE 14

<formid="form1"runat="server">

<asp:ScriptManagerID="ScriptManager1"runat="server"> LINE 16

</asp:ScriptManager>

<asp:PanelID="Panel1"runat="server"CssClass="modalPopup"Height="50px"Width="235px"style="display:none"DefaultButton="btnOk">

<asp:UpdatePanelID="UpdatePanel1"runat="server"UpdateMode="Conditional"> LINE 19

<ContentTemplate> LINE 20

<%=DateTime.Now.ToString() %>

<divstyle="display:none">

<asp:ButtonID="btnRefresh"runat="server"Text="Refresh"OnClick="btnRefresh_Click"/> LINE 23

</div>

</ContentTemplate>

</asp:UpdatePanel>

<asp:ButtonID="btnCancel"runat="server"Text="Cancel"/>

<asp:ButtonID="btnOk"runat="server"Text=" OK "/>

</asp:Panel>

<asp:ButtonID="Button2"runat="server"Text="Button"Enabled="false"style="display:none"/>

<ajaxToolkit:ModalPopupExtenderID="ModalPopupExtender1"runat="server"TargetControlID="Button2"PopupControlID="Panel1"CancelControlID="btnCancel"DropShadow="true"BackgroundCssClass="modalBackground">

</ajaxToolkit:ModalPopupExtender>

<inputid="Button3"type="button"value="Click Me"onclick="showModalPopup()"/>

<scripttype="text/javascript"language="javascript">

function showModalPopup(){

$get("<%=btnRefresh.ClientID %>").click();

$find("<%= this.ModalPopupExtender1.ClientID %>").show();

}

</script>

</form>

</body>

</asp:Content>


from what you have here is that you have a <body> and <form> tags; those normally are already declared in the MasterPage. Check it again.


Yes I added the tags in Master page and removed from content page.

Also I added a masterpage.master.vb file and applied the imports which solved the issue with the scriptmanager.