Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very strange AJAX JavaScript code error
Message
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01326533
Message ID:
01326535
Views:
14
UPDATE. Found it. It was a typo in SP.

>Hi everybody,
>
>I've added one more control to my UserControl (literal).
>
>I'm getting this strange error now:
>
>Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Conversion failed when converting the varchar value 'WBHS' to data type int.
>
>WBHS is the name of the School (School field).
>
>I have a DropDownList on my UserControl like this:
>
> <asp:SqlDataSource ID="SchoolsDataSource" ConnectionString="< %$ ConnectionStrings:FCCMSConnectionString % >"
>            SelectCommand="SELECT RTRIM([School]) + COALESCE(' - ' + [SchoolPhone],'') as SchoolInfo, [School], [SchoolPhone] FROM [Schools] WITH (NOLOCK) WHERE ([siteID] = @siteID)"
>                runat="server">
>                <SelectParameters>
>                    <asp:ProfileParameter Name="SiteID" PropertyName="SiteID" Type ="Int32" />
>                </SelectParameters>
>       </asp:SqlDataSource>
>
><div class="cl">
>        <label class="bx">
>                           School </label><span class="bx">
>        <asp:DropDownList ID="ddlSchool" runat="server"
>                               DataSourceID="SchoolsDataSource"
>            DataTextField="School" DataValueField="School" Width="260px"
>                               >
>                           </asp:DropDownList>
>                           </span>
>                           <asp:Literal ID="litSchoolPhone" runat="server" Text=" " ></asp:Literal>
>                           <br />
>                           <br />
></div>
>
>I only made changes in the SelectCommand and also added new literal control. I also added SchoolPhone to SP in the ASPX that calls this UserControl (and also exposed this property and Bind SchoolPhone in my page).
>
>Do you have ideas where can I look for this error?
>
>This is how this UserControl is set on the page
>
><!-- 4th -->
>                                        <div id="info4" class="cl dn">
>                                            <ScGr:SchoolGradeInfo ID="SchoolGradeVol" runat="server"  EditMode ="false"
>                                                Grade='< %# Bind("Grade") % >'
>                                                School='< %# Bind("School") % >' SchoolPhone ='< %# Bind("SchoolPhone") % >'  />
>
>Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform