Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Wednesday, March 28, 2012

postback happens even when validators show error

Hi,

I am using updatepanel in my code. I give a picture of a part of my code.

Now i have a text box with some validators on it ( required field validator and regular expression validator).

I have a save button which saves the content of the text box .

The textbox is withing the update panel and the save button is outside the update panel.

Now when a wrong iput is entered , on tab out the validator shows the error messgae but on clicking th ebutton , a post back happens. in general case where a update panel is not used the button postback event doesnt happen until the validators return true.

Could you help me on this.

Regards,

Sama

any resolution to this problem yet?

this really needs to be fixed


I also have come across this problem. I have three validators on the footer row of a gridview which is in an UpdatePanel. I use the footer for insertion of new records. When I click 'Insert', the validators fire ok and I get the red asterisks and all but it still posts back. When I take the whole thing out of the UpdatePanel it works as it's supposed to, preventing the postback if no data is entered.

I am using the latest version of Atlas.

Has anyone a solution to this and is it going to be fixed in a future ctp?

Regards,

Andy.


I just investigated further and found the following strage behaviour:

When my page first loads, the gridview is populated with data. The footer is not visible on the gridview as I set ShowFooter() to false by default. There is a button at the bottom of the page "Add Item". This posts back and sets the ShowFooter() to true so that the insert line appears. In this scenario, when the user leaves the new text fields blank, the validator fires but the page still posts back - WRONG.

If I show the footer by default when the page loads, the validators fire correctly and prevent the postback - CORRECT.

Can anyone shed any light on this, I don't want to have my insert line shown by default.

Andy.


bump...

Prefetching Images

I am using the update panel, and the timer control to automatically change a person's profile text, and their photo (small 65x65 pixels). Everything works well so far, except the transition is not always smooth for the photo.

Before the images/photos become cached in the browser, the default broken (link-to-image) image shows up, before the relevant photo loads. After that image loads the first time, the transition is smooth.

Is there a way to prefetch these images (approximately 8) when the page loads?

Thanks,

Karls

The easiest way I know of is to create a .js function to preload the images. Something like:

function preload(){
var imageUrls = ["img1.jpg","img2.jpg","img3.jpg"];
var images = [];
for(var i=0;i<imageUrls.length;i++){
var image = new Image();
image.src = imageUrls[i];
images.push(image);
}
}

That you'd call that function during pageLoad(). Setting the 'src' of the image object should cause the browser to start downloading that image.


Nice,

I would like to try that, but I am having a problem converting this to VB. Can anyone convert this?Huh?


No, i'ts javascript.


Ahh, makes sense now.

Thanks.

Monday, March 26, 2012

Probably, I found a bug [NewLine in MultiLine TextBox]

Try to run this sample (enter to textbox some lines of text, and then click "Post"):

<%@dotnet.itags.org. Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits=".WebForm1" %><!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"> <div><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:UpdatePanel ID="updPanel" ChildrenAsTriggers="true" runat="server"><ContentTemplate><asp:TextBox ID="txtTest" runat="server" TextMode="MultiLine" /><asp:Button ID="butTest" runat="server" Text="Post" /><br /><div style="border:solid 1px red; padding:20px;"><%=txtTest.Text.Replace(Environment.NewLine, "<br/>")%></div></ContentTemplate></asp:UpdatePanel> </div> </form></body></html>

I am using a release version of AST.NET AJAX.

What's the bug?

If you enter some lines of text in Firefox into textbox, and then post it to the server via AJAX, newline symbols will be damaged.

In Opera and IE all works fine.


"Firefox" would be the reason I didn't see the error initially. That is a pretty annoying bug.

I'm experiencing this exact same issue ... did you get it resolved?

Cheers!

Saturday, March 24, 2012

Problem getting AutoComplete Extender to work

Hi I just want to get the autocomplete extender to work with a text box and I'm having trouble getting it to work. It seems like the service isnt being called or that the control isnt working. Compiles fine and no errors in IE when its opened

Heres the code.

AJAXServices.asmx

<%@dotnet.itags.org. WebService Language="VB" CodeBehind="~/App_Code/AjaxServices.vb" Class="AjaxServices" %>

AJAXServices.vb

Imports DataAccess
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Data
Imports System.Data.Common
Imports System.Data.SqlClient
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class AjaxServices
Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function GetModelList(ByVal prefixText As String, ByVal count As Integer) As String()
Dim strSQL As String
Dim titleArList As New List(Of String)
Dim dtModels As DataTable

strSQL = "SELECT DISTINCT Alias FROM LaptopDescTier WHERE Alias LIKE @dotnet.itags.org.Model"
strSQL = strSQL.Replace("@dotnet.itags.org.Model", FormatSQLInfo(prefixText & "%"))
dtModels = ReturnTable(strSQL)

For Each drModel As DataRow In dtModels.Rows
titleArList.Add(drModel("Alias").ToString)
Next

Return titleArList.ToArray()

End Function

End Class

UpdateLaptopModels.aspx

<%@dotnet.itags.org. Page AutoEventWireup="false" CodeFile="UpdateLaptopModels.aspx.vb" Inherits="UpdateLaptopModels"
Language="VB" MaintainScrollPositionOnPostback="true" MasterPageFile="~/Admin.master"
Title=":: Laptop Management System ~ Administration ::" %
<asp:Content ID="Content1" runat="Server" ContentPlaceHolderID="cphAdmin">
<asp:ScriptManager ID="ScriptManager" runat="server">
</asp:ScriptManager>
<div class="Container">
<h2>
Update Laptops Models</h2>
<div class="StandardBreakSpace">
</div>
<asp:TextBox ID="txtAlias" runat="server"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="aceAlias" runat="server" CompletionInterval="1000"
CompletionSetCount="12" EnableCaching="true" MinimumPrefixLength="1" ServiceMethod="GetModelList" Enabled="true"
ServicePath="Services/AjaxServices.asmx" TargetControlID="txtAlias">
</ajaxToolkit:AutoCompleteExtender>
</div>
</asp:Content>

Web.config

<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings>

</appSettings>
<connectionStrings>

</connectionStrings>
<system.web>
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
</controls>
</pages>
<identity impersonate="true"/>
<authentication mode="Windows"/>
<customErrors mode="RemoteOnly" defaultRedirect="Error.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
<profile>
<properties>
<add name="SearchTerms" type="System.Collections.Specialized.StringCollection" serializeAs="Xml"/>
</properties>
</profile>
</system.web>
<system.web.extensions>
<scripting>
<webServices>

<!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
<!--
<jsonSerialization maxJsonLength="500">
<converters>
<add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
</converters>
</jsonSerialization>
-->
<!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
<!--
<authenticationService enabled="true" requireSSL = "true|false"/>
-->
<!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
writeAccessProperties attributes. -->
<!--
<profileService enabled="true"
readAccessProperties="propertyname1,propertyname2"
writeAccessProperties="propertyname1,propertyname2" />
-->
</webServices>
<!--
<scriptResourceHandler enableCompression="true" enableCaching="true" />
-->
</scripting>
</system.web.extensions>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
</configuration


Once I get this working I want to use the text box and extender in a itemtemplate in a gridview. Will that work?

Thanks for looking into this and all suggestions are welcome!

Dude, found it!!!

change this...


<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class AjaxServices
Inherits System.Web.Services.WebService

End Class

TO

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<System.Web.Script.Services.ScriptService()> _
Public Class AjaxServices
Inherits System.Web.Services.WebService

End Class


I'll give this a try at work tomorrow. I just gave up. If this works, you are truly the man!Wink



If not, you can try this:

http://forums.asp.net/thread/1563579.aspx

I had trouble getting autocomplete in vb to work, and listed a few things I noticed there.

(Using in-page methods, no .asmx)


Jared,

Unfortunately even this doesnt get it to fire. I wonder if you could put together a quick sample that fires in VB to use as a template.


I posted my working code (simplified) on the thread i linked above...

FYI - I've been banging my head all day, and this worked for me. Is there something to be done to get around the need to remember to make this change? This was a pre-exising ASP.NET app to which I'm adding AJAX functionality.

Thanks!

rojay12:

Dude, found it!!!

change this...


<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class AjaxServices
Inherits System.Web.Services.WebService

End Class

TO

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<System.Web.Script.Services.ScriptService()> _
Public Class AjaxServices
Inherits System.Web.Services.WebService

End Class

Wednesday, March 21, 2012

problem in serverside validation

hi to all

i have few text box and button in updatepanel . Now i want to do asynchronously postback on button click and for that

i have did my all validation on serverside as follow

CS code

1protected void btnSubmit_Click(object sender, ImageClickEventArgs e)
2 {
3
45try6 {
7if (cmbAdvertisementType.SelectedValue =="0")
8 {
9throw new Exception("You must select a Advertisement Style.");
10 }
1112if (cmbKiosk.SelectedValue =="0")
13 {
14throw new Exception("You must select a Server.");
15 }
1617if (string.IsNullOrEmpty(txtFromDate.Text))
18 {
19throw new Exception("You must supply a Start Date.");
20 }
2122if (string.IsNullOrEmpty(txtToDate.Text))
23 {
24throw new Exception("You must supply an EndDate.");
25 }
2627
2829 System.Threading.Thread.Sleep(4000);
30 DataTable parameterTable = objdt.GetTable();
31 parameterTable.Rows.Add(objdt.CreateRow("@dotnet.itags.org.StarDate", SqlDbType.DateTime, 30, Convert.ToDateTime(txtFromDate.Text, format), ParameterDirection.Input));
32 parameterTable.Rows.Add(objdt.CreateRow("@dotnet.itags.org.EndDate", SqlDbType.DateTime, 30, Convert.ToDateTime(txtToDate.Text, format), ParameterDirection.Input));
33 parameterTable.Rows.Add(objdt.CreateRow("@dotnet.itags.org.ServerId", SqlDbType.Int, 4, Convert.ToInt32(cmbKiosk.SelectedValue), ParameterDirection.Input));
34 parameterTable.Rows.Add(objdt.CreateRow("@dotnet.itags.org.AdvertiseId", SqlDbType.Int, 4, Convert.ToInt32(cmbAdvertisementType.SelectedValue), ParameterDirection.Input));
35 parameterTable.Rows.Add(objdt.CreateRow("@dotnet.itags.org.Mode", SqlDbType.VarChar, 10,"Dataset", ParameterDirection.Input));
36 ds = objDB.GetDSByProcedure("SP_CheckAvailibily", parameterTable);
37 parameterTable.Rows.Clear();
38 gvSlotAvailibily.DataSource = ds;
39 gvSlotAvailibily.DataBind();
40 AccordionView.SelectedIndex = 1;
41 UpdatePanel2.UpdateMode = System.Web.UI.UpdatePanelUpdateMode.Always;
42 UpdatePanel2.ChildrenAsTriggers =true;
43 }
44catch (Exception ex)
45 {
4647 sendPopupMessage(ex.Message);
48 }
49
50 }
5152
5354private void sendPopupMessage(string Message)
55 {
56 ScriptManager.RegisterStartupScript(this,this.GetType(),"key","<script language='Javascript'> alert('" + Message +"'); </script>",false);
57 }

aspx code

1<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="AdvertiseBook.aspx.cs" Inherits="AdvertiseBook" Title="Advertisement Booking" %>2<%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit"%>3<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">4<aspajax:ScriptManager ID="ScriptManager2" EnablePageMethods="True" EnablePartialRendering="true" EnableScriptLocalization="true" runat="server">5 <Scripts>6 <aspajax:ScriptReference Path="AdvertiseBook.js" />78 </Scripts>910 <Services>11 <aspajax:ServiceReference Path="WebService.asmx" />12 </Services>1314 </aspajax:ScriptManager>1516 <div id="lmenucontainer">17 <div class="menuitem" id="m1" name="m1">18 <asp:LinkButton runat="server" Text="Tabular View" ID="lnkView" onmouseover="lmenuover(m1.id);" onmouseout="lmenuout(m1.id);" OnClick="lnkView_Click"></asp:LinkButton>19 </div>20 <div class="menuitem" id="m2" name="m2">21 <asp:LinkButton runat="server" Text="Add New Agency" ID="lnkaddAgency" onmouseover="lmenuover(m2.id);" onmouseout="lmenuout(m2.id);" OnClick="lnkaddAgency_Click"></asp:LinkButton>22 </div>23 <div id="lm5" onmouseover="lmenuover('lm5');" class="menuitem bottomborder" onmouseout="lmenuout('lm5');" name="lm5">24 <asp:LinkButton id="lnkNewAd" onmouseover="lmenuover('lm5');" onmouseout="lmenuout('lm5');" runat="server" Text="New Advertisement" OnClick="lnkNewAd_Click"></asp:LinkButton>25 </div>26 </div><!-- lmenucontainer closing -->27 <aspajax:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" ChildrenAsTriggers="False" runat="server">28 <ContentTemplate>2930 <div id="disparea" >31 <asp:Panel ID="pnlTableView" runat="server" Visible="false">32 <ajaxToolkit:Accordion ID="AccordionView" runat="server" SelectedIndex="0"33 HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected"34 ContentCssClass="accordionContent" FadeTransitions="false" FramesPerSecond="40"35 TransitionDuration="250" AutoSize="None" RequireOpenedPane="false" SuppressHeaderPostbacks="true">36 <Panes>37 <ajaxToolkit:AccordionPane ID="AccordionPane5" runat="server">38 <Header><a href="http://links.10026.com/?link=" class="accordionLink">Check Availibility of Slot</a></Header>39 <Content>40 <table>41 <tr>42 <td>43 <asp:Label ID="lblAdvertisementType" runat="server" Text="Advertisement Type" ></asp:Label>44 </td>45 <td>46 <asp:DropDownList ID="cmbAdvertisementType" runat="server" OnLoad="cmbAdvertisementType_Load">47 </asp:DropDownList>48 </td>49 </tr>50 <tr>51 <td>52 <asp:Label ID="lblKiosk" runat="server" Text="Kiosk Name" ></asp:Label>53 </td>54 <td>55 <asp:DropDownList ID="cmbKiosk" CssClass="cmbborder" runat="server" OnLoad="cmbKiosk_Load" ></asp:DropDownList>56 </td>57 </tr>58 <tr>59 <td >60 <asp:Label ID="lblFrom" runat="server" Text="From" ></asp:Label>   61 </td><td>62 <asp:TextBox ID="txtFromDate" EnableViewState="true" runat="server"></asp:TextBox>63 <asp:Image ID="imgFromDate" ImageUrl="~/images/Calendar_scheduleHS.png" runat="server" />64 <ajaxToolkit:CalendarExtender ID="CalendarExtender1" Format="dd/MM/yyyy" Animated="true"65 PopupButtonID="imgFromDate" TargetControlID="txtFromDate" EnableViewState="true" runat="server">66 </ajaxToolkit:CalendarExtender>67 </td></tr>68 <tr><td>69 <asp:Label ID="lblTo" runat="server" Text="To" ></asp:Label>70 </td><td>71 <asp:TextBox ID="txtToDate" EnableViewState="true" runat="server"></asp:TextBox>72 <asp:Image ID="imgToDate" ImageUrl="~/images/Calendar_scheduleHS.png" runat="server" />73 <ajaxToolkit:CalendarExtender ID="CalendarExtender2" Format="dd/MM/yyyy" Animated="true"74 PopupButtonID="imgToDate" TargetControlID="txtToDate" EnableViewState="true" runat="server">75 </ajaxToolkit:CalendarExtender>76 </td>77 </tr>78 <tr>79 <td colspan="2" align="center">80 <asp:ImageButton ImageUrl="~/images/submit.gif" ID="btnSubmit" runat="server" OnClientClick="CheckDateValidation();" OnClick="btnSubmit_Click" />8182 </td>83 </tr>848586 </table>87 </Content>88 </ajaxToolkit:AccordionPane>89 <ajaxToolkit:AccordionPane ID="AccordionPane6" runat="server">90 <Header><a href="http://links.10026.com/?link=" class="accordionLink">Tabular View of Slot Allocation</a></Header>91 <Content>92 <asp:GridView AutoGenerateColumns="false" AllowPaging="true" ShowFooter="true" ShowHeader="true" ID="gvSlotAvailibily" runat="server" OnPageIndexChanging="gvSlotAvailibily_PageIndexChanging" >93 <Columns>94 <asp:BoundField DataField="DATE" DataFormatString="{0:MM-dd-yyyy}" HeaderText="Date" />95 <asp:BoundField DataField="Available" HeaderText="Available Slot" ItemStyle-HorizontalAlign="Center" />96 <asp:BoundField DataField="TempBookSlot" HeaderText="Temp Booked Slot" ItemStyle-HorizontalAlign="Center" />97 <asp:BoundField DataField="BookedSlot" HeaderText="Booked Slot" ItemStyle-HorizontalAlign="Center" />98 <asp:BoundField DataField="TotalSlot" HeaderText="Total Slot" ItemStyle-HorizontalAlign="Center" />99 </Columns>100 </asp:GridView>101102 </Content>103 </ajaxToolkit:AccordionPane>104 </Panes>105 </ajaxToolkit:Accordion>106107108 </asp:Panel>109 </div>110 </ContentTemplate>111 <Triggers>112 <aspajax:AsyncPostBackTrigger ControlID="lnkaddAgency" EventName="Click" />113 <aspajax:AsyncPostBackTrigger ControlID="lnkNewAd" EventName="Click" />114 <aspajax:AsyncPostBackTrigger ControlID="lnkView" EventName="Click" />115 <aspajax:AsyncPostBackTrigger ControlID="btnadvertiseSubmit" EventName="Click" />116 </Triggers>117118119 </aspajax:UpdatePanel>

but it not working properly

Both should work

ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "<script language='Javascript'> alert('" + Message + "'); </script>", false);

ScriptManager.RegisterStartupScript(this, this.GetType(), "key", " alert('" + Message + "'); ", true);


here problem is not with sendPopupMessage()

actully after 1st validation it doesn't get submit



http://www.asp.net/AJAX/Documentation/Live/mref/O_T_System_Web_UI_ScriptManager_RegisterStartupScript.aspx

Better way you use validators..

But see for more details

Validation controls, which includes theBaseCompareValidator,BaseValidator,CompareValidator,CustomValidator,RangeValidator,RegularExpressionValidator,RequiredFieldValidator, andValidationSummary control are not compatible with UpdatePanel

See it here

http://weblogs.asp.net/scottgu/archive/2007/01/25/links-to-asp-net-ajax-1-0-resources-and-answers-to-some-common-questions.aspx

You can downlaod compatible ersion of validators from here

http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx