No source code available

Last post 03-27-2009 9:28 AM by MaryFran. 10 replies.

Sort Posts:

  • No source code available

    03-23-2009, 3:05 PM
    • Member
      3 point Member
    • MaryFran
    • Member since 01-16-2008, 4:36 PM
    • Posts 59

    Hi - I'm new to AJAX control extenders and thought I had everything in place to make a maskededitextender work properly (Script Manager on Master Page, ...) but when I go to debug I get the "No source code available in the current location".  Have I forgotten something?

     

     

  • Re: No source code available

    03-24-2009, 10:31 AM
    • Member
      3 point Member
    • MaryFran
    • Member since 01-16-2008, 4:36 PM
    • Posts 59

     

    In addition to previous post - I had created the MaskedEditExtender in source code - now notice that if I go to the toolbox I am not able to drag and drop any of the Ajax controls onto design.   Can anyone help?  Thanks.

     

  • Re: No source code available - now "an entry with the same key already exists"

    03-24-2009, 4:07 PM
    • Member
      3 point Member
    • MaryFran
    • Member since 01-16-2008, 4:36 PM
    • Posts 59

    And the latest - I was missing ControlToValidate in extender validator and when added I now get the subject's latest error message ("an entry with the same key...") Here is my source code if anyone could PLEASE offer a suggestion.

    <InsertItemTemplate>

    <asp:TextBox ID="txtStarttime" runat="server"

    Text='<%# Bind("Starttime") %>'></asp:TextBox>

    <cc1:MaskedEditExtender ID="txtStarttime_MaskedEditExtender" runat="server"

    TargetControlID="txtStarttime" AcceptAMPM="true" Mask = "99:99" masktype="Time"/>

    <cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server"

    ControlExtender="txtStarttime_MaskedEditExtender" ControlToValidate="txtStartTime"

    EmptyValueMessage="Please enter a Start time" Display="Dynamic" IsValidEmpty="false"

    ErrorMessage="Invalid time" TooltipMessage="Enter a valid time and A or P for am/pm"/>

    </InsertItemTemplate>

  • Re: No source code available - now "an entry with the same key already exists"

    03-26-2009, 8:23 AM
    Hi MaryFran,

    Please refer to my reply in this thread: http://forums.asp.net/p/1400680/3039649.aspx#3039649


    Best regards,

    Zhi-Qiang Ni

    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
    Answer” if a marked post does not actually answer your question.
  • Re: No source code available - now "an entry with the same key already exists"

    03-26-2009, 8:57 AM
    • Member
      3 point Member
    • MaryFran
    • Member since 01-16-2008, 4:36 PM
    • Posts 59

    That is essentially the same as what I have, Zhi-Qiang.  The only difference is your ValidationExpression, and I went ahead and changed mine to yours - still get error.  I had the "Register assembly...", too.  Do you have any other ideas?  I know it's in the Validator because the extender works without the validator.

     

     

  • Re: No source code available - now "an entry with the same key already exists"

    03-26-2009, 11:25 PM
    Answer

    Hi MaryFran,

    From your code and description, I assume that you have placed the MaskEditControl inside a DetailView’s Field InsertItemTemplete. If so, please refer to my sample code here all based on yours.

    .aspx file 

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MaskInDataControl.aspx.cs"
        Inherits="SoluTest_Mask.MaskInDataControl" %>
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    <!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></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" AutoGenerateRows="False"
                DataKeyNames="ID" DataSourceID="SqlDataSource1">
                <Fields>
                    <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                        SortExpression="ID" />
                    <asp:TemplateField HeaderText="Field1" SortExpression="Field1">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Field1") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="txtStartTime" runat="server" Text='<%# Bind("Field1") %>' />
                            <cc1:MaskedEditExtender ID="txtStarttime_MaskedEditExtender" runat="server" TargetControlID="txtStarttime"
                                AcceptAMPM="true" Mask="99:99" MaskType="Time" />
                            <cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="txtStarttime_MaskedEditExtender"
                                ControlToValidate="txtStartTime" EmptyValueMessage="Please enter a Start time"
                                Display="Dynamic" IsValidEmpty="false" ErrorMessage="Invalid time" TooltipMessage="Enter a valid time and A or P for am/pm" />
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Field1") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ShowInsertButton="True" />
                </Fields>
            </asp:DetailsView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>"
                DeleteCommand="DELETE FROM [AssName] WHERE [ID] = ?" InsertCommand="INSERT INTO [AssName] ([ID], [Field1]) VALUES (?, ?)"
                ProviderName="<%$ ConnectionStrings:DatabaseConnectionString.ProviderName %>"
                SelectCommand="SELECT [ID], [Field1] FROM [AssName]" UpdateCommand="UPDATE [AssName] SET [Field1] = ? WHERE [ID] = ?">
                <DeleteParameters>
                    <asp:Parameter Name="ID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Field1" Type="String" />
                    <asp:Parameter Name="ID" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="ID" Type="Int32" />
                    <asp:Parameter Name="Field1" Type="String" />
                </InsertParameters>
            </asp:SqlDataSource>
        </div>
        </form>
    </body>
    </html>
    Have it helped?

    Best regards,

    Zhi-Qiang Ni

    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
    Answer” if a marked post does not actually answer your question.
  • Re: No source code available

    03-27-2009, 5:31 AM
    • Star
      8,699 point Star
    • Pawan_Mishra
    • Member since 03-13-2008, 11:37 AM
    • Bangalore
    • Posts 1,272

     Hi

    You can try the following steps to solve this problem (hopefully):-

    1.) Right click on the solution and select properties 

    2.) In the property page(kind of popup) you will see some options on left side .

    3.) In that options select debug options

    4.) Once you select debug option , you will see two sections namely :- directories containing source code and do not look for this source files

     5.) Select everything which is present in 'do not look for this source files" and delete it .

    and then compile your source code .

     

    Regards
    Pawan Mishra

    Too many eyes doesn't make a good code !!!

    .Net 360°
  • Re: No source code available - now "an entry with the same key already exists"

    03-27-2009, 8:46 AM
    • Member
      3 point Member
    • MaryFran
    • Member since 01-16-2008, 4:36 PM
    • Posts 59

    Yes, Zhi-Qiang, I did have the same MaskedEditExtender in the InsertItemTemplate of the DetailsView but left off the Validator b/c I get that same message "an entry with the same key exists" if I use it.  And I copied and pasted your Validator as a double-check.  I appreciate your continued attempts to resolve this issue...

     

  • Re: No source code available

    03-27-2009, 8:49 AM
    • Member
      3 point Member
    • MaryFran
    • Member since 01-16-2008, 4:36 PM
    • Posts 59

    Are these steps to solve the "no source code error", Pawan?  If so, my previous post indicates that when I added the missing ControltoValidate="txtStarttime" that error was replaced with the "an entry with the same key exists".

    Do I still need to do what you've suggested?

     

  • Re: No source code available

    03-27-2009, 9:10 AM
    • Star
      8,699 point Star
    • Pawan_Mishra
    • Member since 03-13-2008, 11:37 AM
    • Bangalore
    • Posts 1,272

     No, If the issue is resolved then you wont have to go for the steps which I have mentioned . Sometimes when using ajaxControlToolkit extenders this error comes up "No source code available" during debugging process . And i suggested the same solution for another thread of same forum and it worked that time . But still I will advise you to just try what ever I have said and if you find some entries in the section which I have mentioned then delete all those entries .

     

    Regards
    Pawan Mishra

    Too many eyes doesn't make a good code !!!

    .Net 360°
  • Re: No source code available

    03-27-2009, 9:28 AM
    • Member
      3 point Member
    • MaryFran
    • Member since 01-16-2008, 4:36 PM
    • Posts 59

    Okay, thanks, I will save this advice.  I can't Mark as Answer until I get the solution to my issue, though, b/c I still need assistance.

     

Page 1 of 1 (11 items)