Category Archives: ScriptManagerProxy

[RESOLVED] textbox onchange

Why this function checkDate() is not invoked after I type a date into the textbox and tab out of it?

<asp:TextBox ID="tb1"  OnTextChanged="tb1_Changed" OnChange="checkDate" runat="server"></asp:TextBox>
                   
<script type="text/javascript">
      function checkDate(sender, args) {
            if (sender._selectedDate > new Date())
            {
                alert("date is later than today");
            }
        }
</script>

Because the function is expecting two parameters.  This should fire the function, you'll have to do the rest:

   onchange="checkDate(this, 1);"

Thanks for the tip.

When I use if (sender._selectedDate > new Date()) and selected date from a calendar control is 12/12/2013, it evaluates to true and that's correct. But when I type 12/12/2013 into the textbox and the following statement is evaluated to false when it should be true.

if (sender.value > new Date())

sender.value is 12/12/2013 and it's supposed to be > today but it's not because of formatting. How can it be formatted so the statement evaluates to true?

 

compare date using javascript - http://www.w3schools.com/jS/js_obj_date.asp

I googled for a solution and also looked at he link you provided, but none matches what I'm looking for. Can you be more specific on how to change the format of the sender.value in the statement "if (sender.value > new Date())" so that it can evaluate to true? Thanks.

this will not work. you can not directly set onchange function in aspx page..

Add below code in your code behind page and remvpe this OnChange="checkDate" from your aspx page..

tb1.Attribures.Add("OnChange","return checkDate(this,event)");

Let me know if you will face any isssue with this.

OnChange works fine in aspx page. That's not the problem.

The problem is how to change the format of the sender.value in the statement "if (sender.value > new Date())" so that it can evaluate to true.

I think you will have to compare each fields of the Date  - day, month, year. Whnen you get date from Calendar, it has a time component assiciated with that is resulting in the unexpected error.

Let's say today is 4/25/2011. It's strange that todayFormat becomes 55/25/2011. What is wrong with the today.format("mm/dd/yyyy") statement?

Is there a quick way to parse enteredDate into mm/dd/yyyy?

Instead of having to parse enteredDate into separate dd, mm, yyyy pieces and compare each piece with today's date, I want to compare the entire mm/dd/yyyy string in one shot.

 

var today = new Date();
            var todayFormat = today.format("mm/dd/yyyy");
            
            var dd = today.getDate();
            var mm = today.getMonth() + 1; //January is 0!
            var yyyy = today.getFullYear();

            var enteredDate = sender.value;
            if (isNaN(enteredDate))
                alert('empty');
            else
                //parse enteredDate into mm/dd/yyyy

 

i guess the strange result you obtained is due to the format mm/dd/yyyy, you are passing in mm(lowercase) is for minutes, please try MM/dd/yyyy.

I am affraid that compare the entire MM/dd/yyyy string in one shot is not a good idea, and logic error as example below with MM/dd/yyy format:

"02/1/2009" > "08/01/2008" = false

should not happen in date comparison

Try the following code

var today = new Date();
today.setHours(0, 0, 0, 0);
if (sender._selectedDate > today)
{
}
else
{
}

Why does today.setHours(0, 0, 0, 0); gives this result 1303963200000. Eventhough that works, I have no idea what that number represent.

http://www.w3schools.com/jsref/jsref_setHours.asp

I think that returned number is the numeric offset for Date in Javascript

I saw that article before but couldn't figure out how 04/28/2011 could turn out to be 1303963200000 after invoking the setHours() function. I think all the 0 at the end represent time, but the number of 0 doesn't match with (hour,min,sec,millisec).

I even try today.setHours(14) and it gives 1304100000000. The link from w3schools would give "Fri Apr 29 14:00:00 EDT 2011" which makes a lot of sense. Not sure why my setHours() gives totally different output than the one from the link.

 

I think the easiest way to fix the issue is to use the same format for all dates. To do so you can use the calendar extender. http://www.asp.net/ajax/ajaxcontroltoolkit/samples/calendar/calendar.aspx

I already used the calendar extender, but even with that users are still and should be able to type a date instead of using the calendar. Any way, the web site from your link provides very good examples but it doesn't show source code. Is there a way to get source code for the examples?

Hi,

pinky8

Any way, the web site from your link provides very good examples but it doesn't show source code. Is there a way to get source code for the examples?

I would like to suggest you to check the link below for an article which describes how to configure the Ajax Calendar control.

Ajax Calendar Control

Here is a similar thread which provides some solutions for the same issue,please check it and see whether it helps.

AjaxControlToolKit Calendar validation:http://forums.asp.net/t/1444042.aspx

Hope it can help you.

THank you for the information but my question is why does today.setHours(14) gives 1304100000000. The link from w3schools http://www.w3schools.com/jsref/jsref_setHours.asp would give "Fri Apr 29 14:00:00 EDT 2011". Not sure why my setHours() gives totally different output than the one from the link, and what does 1304100000000 represent?

Hi,

pinky8

Not sure why my setHours() gives totally different output than the one from the link

For my experience ,the output result comes from document.write(today.setHours(14)); in your JavaScript function, it is different from the code:document.write(today); which is contained in the link(http://www.w3schools.com/jsref/jsref_setHours.asp) as you mentioned.

pinky8

and what does 1304100000000 represent?

Let me explain the JavaScript setHours() method:

The syntax of setHours() method:

var date = new Date();
date.setHours(hours);
date.setHours(hours, minutes);
date.setHours(hours, minutes, seconds);
date.setHours(hours, minutes, seconds, microseconds);

The parameters of setHours() method above:

1.hours - integer(0 - 23) as hour object of date
2.minutes - integer(0 - 59) as minute object of date.
3.seconds - integer(0 - 59) as second object of date.
4microsecond - integer(0 - 999) as millisecond object of date.

If minutes or seconds or microseconds are out of range, the date will also be adjusting.

The output result:

1.document.write(today.setHours(14));  returns a integer value.
2.the value of document.write(today.setHours(14)); means how many milliseconds between the date object(which is created) and 1970/1/1 midnight.

The sample of  setHours() method:

    <script language="javascript" type="text/javascript">
var d = new Date();
document.write("How many milliseconds between the date object(which is created) and 1970/1/1 midnight : " + d.setHours(10, 5, 8, 6)+"<br/><br/>");
document.write("Value of Date : "+d+"<br/><br/>");
var nd = new Date();
var milliseconds = nd.setHours(10, 21, 8, 6);
document.write("How many milliseconds between the new date object(which is created) and 1970/1/1 midnight : " + milliseconds+"<br/><br/>");
document.write("Value of new Date : "+nd+"<br/><br/>");

    </script>

Hope it can help you.

Hi Ming,

Thank you for explaining it thoroughly. It's interesting that 1970/1/1 is used. Did someone just pick that date? I guess the following code should always work no matter whether "youTypeThisDate" is way way back in the 1900's or something this year.

var today = new Date();
var todayFormat = today.setHours(0, 0, 0, 0);
if (youTypeThisDate > todayFormat)
     alert("You cannot select a date that is later than today");

After the line alert() above, I add your code to try it out. It's weird that it displays the output fine and then gives an error about permission denied. Without your code it works fine.

Ming Xu - MSFT

var d = new Date(); document.write("How many milliseconds between the date object(which is created) and 1970/1/1 midnight : " + d.setHours(10, 5, 8, 6)+"<br/><br/>"); document.write("Value of Date : "+d+"<br/><br/>"); var nd = new Date(); var milliseconds = nd.setHours(10, 21, 8, 6); document.write("How many milliseconds between the new date object(which is created) and 1970/1/1 midnight : " + milliseconds+"<br/><br/>"); document.write("Value of new Date : "+nd+"<br/><br/>");

Hi,

pinky8

I guess the following code should always work no matter whether "youTypeThisDate" is way way back in the 1900's or something this year.

var today = new Date();
var todayFormat = today.setHours(0, 0, 0, 0);
if (youTypeThisDate > todayFormat)
     alert("You cannot select a date that is later than today");

Please modify the code as below:

var today = new Date();
today.setHours(0, 0, 0, 0);
if (youTypeThisDate > today )                 
     alert("You cannot select a date that is later than today");

pinky8

It's weird that it displays the output fine and then gives an error about permission denied. Without your code it works fine.

For my experience ,the issue is related to any document.write() methods after the page has loaded will replace the entire page. I would like to suggest you to create a new page to test the code which I mentioned in my previous reply.

Hope it can help you.

Thank you! I'll close out this thread. I have other threads that I've been waiting for someone to help but no solution yet. I wonder if you could please take a look at them. I really appreciate that. They are: http://forums.asp.net/t/1677623.aspx/1?Undo+with+UpdatePanel and http://forums.asp.net/t/1676618.aspx/1?disable+field and http://forums.asp.net/t/1673713.aspx/1?ScriptManagerProxy and http://forums.asp.net/t/1673719.aspx/1?get+option+text+instead+of+value

pinky8

Thanks for the tip.

When I use if (sender._selectedDate > new Date()) and selected date from a calendar control is 12/12/2013, it evaluates to true and that's correct. But when I type 12/12/2013 into the textbox and the following statement is evaluated to false when it should be true.

if (sender.value > new Date())

sender.value is 12/12/2013 and it's supposed to be > today but it's not because of formatting. How can it be formatted so the statement evaluates to true?

 

 

the problem here is you are comparing a string to date, so the date is converted to a string before the compare. you want to compare a date to a date.

 

   if (isNaN(Date.parse(sender.value)) alert('not a valid date');
   else if (new Date(sender.value) > new Date())
      ....

 note1: Date.parse returns a number not a date. new Date(stringvalue) converts a string to a date. 
 note2: internally a javascript date is the number of milliseconds since 1/1/1970 (the unix start date). 

 

 

Try this code instead of scratching with javascript, any how u r using a asp textbox which will cause a postback on textchanged so u can use the following code check validation....

protected void Calendar1_SelectionChanged(object sender, EventArgs e)
        {
            if (Calendar1.SelectedDate < System.DateTime.Now.Date)
            {
                Label1.Text = "Invalid date";
            }
            else
            {
                Label1.Text = "";
                TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();
            }
        }

 

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

Hope this might help u...

please mark it as answer

Have a nice dayCool

 

you can use javascript to achive this  with below function...

http://amitpatelit.wordpress.com/2011/02/23/future-date-validation-by-java-script/

[RESOLVED] problems with two usercontrols

Hello, I have two UserControls, each one has the ScriptManager tag, each one has TabContainer control and UpdatePanel. I need to put both UserControl in one WebForm, but I recived the error "Only one instance of a ScriptManager can be added to the page".

How can i resolve this???

I usually put the ScriptManager in a MasterPage and then each inherited page or control uses the ScriptManagerProxy.

http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanagerproxy.aspx

 

Matt

Remove the ScriptManager from the user controls and place it directly on the page.

In general, you should not include any controls within a user control that can only have one instance on a page.  For these user controls, always treat them like AJAX controls and you shouldn't have any issues.

User controls don't have their own existance like ASPX page. I mean to say when you place the user control onto an ASPX page, it becomes the part of the ASPX page.

And an ASPX page can have one and only one instance of script manager control.

So you should not place the ScriptManager control onto a user control. Rather than you should add the ScriptManager control onto the ASPX page itself or on the MasterPage if the ASPX page uses a master page.

Hope this well help.

Please mark it as ANSWER if it helps.

[RESOLVED] MultiView stop loading hidden view's controls.

Hi All,

 I have a multiview control on my page. How can I stop the controls in the non-displaying views from being loaded / initialized? I have a lot of data bound to each view, and don't want to have to load BOTH views every time the page loads. Thanks :)

*bump* 

How come there are no replies ever to any of my posts. There are several MVPs on here and they can't shed any light on this issue? If it can't be done, I would at least like a "it can't be done, sorry!" from some one...

paradoxperfect

I have a multiview control on my page. How can I stop the controls in the non-displaying views from being loaded / initialized? I have a lot of data bound to each view, and don't want to have to load BOTH views every time the page loads. Thanks :)

 

Hi paradoxperfect,

Q1:I have a multiview control on my page. How can I stop the controls in the non-displaying views from being loaded / initialized?

A1:Base on my experience, when a page load and post back, it will only load one view which active view, so you do not need to care about the controls in the non-displaying view.

Q2:I have a lot of data bound to each view, and don't want to have to load BOTH views every time the page loads.

A2:Please refer A1 

Please correct me if I have misunderstood your mean, please LET ME KNOW, Thanks, 

Hope it helps,

Hong Gang


 

Thanks for the reply Hong Gang.

That was my assumption too. Try this:

Create a page with a multiview that has two views. In both views button a button to switch to "the other" view. Now also in each of the views create a scriptmanagerproxy to include some JS (seperatly for both views), you will obviously need to create a scriptmanager to "append" these scripts. Now load the page in a browser and you will see that BOTH JS scripts are loaded independent of the view loaded. Also, on EACH of the button's Load events, do someting (at least in VB.NET) like Response.Write("Hello") or the time. You will see that it will be written for BOTH controls independent of the view that is loaded. It initializes / loads the controls, but doesn't render them. And that is wasting a lot of resources. Please help me out! Thanks!

*bump* 

*bump again*

paradoxperfect

Thanks for the reply Hong Gang.

That was my assumption too. Try this:

Create a page with a multiview that has two views. In both views button a button to switch to "the other" view. Now also in each of the views create a scriptmanagerproxy to include some JS (seperatly for both views), you will obviously need to create a scriptmanager to "append" these scripts. Now load the page in a browser and you will see that BOTH JS scripts are loaded independent of the view loaded. Also, on EACH of the button's Load events, do someting (at least in VB.NET) like Response.Write("Hello") or the time. You will see that it will be written for BOTH controls independent of the view that is loaded. It initializes / loads the controls, but doesn't render them. And that is wasting a lot of resources. Please help me out! Thanks!

 

Could you post your code here for us checking?

Waiting for your feedback,

Hong Gang 

Hello Hong Gang,

 Dump the following code into a page and you will see that when the page loads, ALL of the JS files get loaded into the page, meaning ALL of the views are getting loaded, but not necessairly rendered. I think the way ScriptManager must work is that if it finds any child nodes, it adds the script to the page's script manager. I only want the controls to be initialized if they're in the view:

<form id="form1" runat="server">
    <asp:ScriptManager runat="server">
        <Scripts>
            <asp:ScriptReference Path="mainjsfile.js" />
        </Scripts>
    </asp:ScriptManager>
    <div>
        <asp:MultiView runat="server" ID="myMultiView" ActiveViewIndex="0">
            <asp:View runat="server">
                <asp:ScriptManagerProxy runat="server">
                    <Scripts>
                        <asp:ScriptReference Path="view0jsfile.js" />
                    </Scripts>
                </asp:ScriptManagerProxy>
                View Index Zero
            </asp:View>
            <asp:View runat="server">
                <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
                    <Scripts>
                        <asp:ScriptReference Path="view1jsfile.js" />
                    </Scripts>
                </asp:ScriptManagerProxy>
                View Index One
            </asp:View>
        </asp:MultiView>
    </div>
    </form>
Give this a try by viewing the source of the page that is loaded. Thanks!

*bump for Hong Gang*

*bump again*

Waiting for reply from Hong Gang... 

bump for a fourth time... 

I'm really starting to hate this forum. I've posted MANY topics before and NONE of them have ever been resolved. I usually end up creating my own hack for the workaround. I'm sick of people viewing my threads over 1000 times and NOT REPLYING. I'm really sure that someone knows the answer to my question. Everyone is just so used to such simple minded questions where all the user had to do was read some kind of tutorial. This is a forum, not a "let's ignore the OP's posts". There are plenty of MVPs on here that are supposedly of this "MVP" status, but can't even answer some simple questions. Like I said, this is a forum and it should be a community where everyone helps everyone; not just the posters who obviously haven't read a tutorial. I mean, there's nothing wrong with that, but what about the rest of us who HAVE experience and would like a little more support.

 Like I stated in one of my previous posts, even if it's a "Sorry that's the way the control is built but here's some alternative" then hey that's FINE by me. All I want is some answers...
 

Q1: 

paradoxperfect

Create a page with a multiview that has two views. In both views button a button to switch to "the other" view. Now also in each of the views create a scriptmanagerproxy to include some JS (seperatly for both views), you will obviously need to create a scriptmanager to "append" these scripts. Now load the page in a browser and you will see that BOTH JS scripts are loaded independent of the view loaded.

A1:

Base on my understanding, you want to load JavaScript dynamically,  I write a demo for your reference, see the demo:

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = Convert.ToInt32(DropDownList1.SelectedValue);
    }

    protected void Page_Load(object sender, EventArgs e)
    {

        ScriptManager1.Scripts.Add(new ScriptReference("js/JScript.js"));
        //switch(MultiView1.ActiveViewIndex)
        //{
        //    case 0: ScriptManager1.Scripts.Add(new ScriptReference("")); break;
        //    case 1: ScriptManager1.Scripts.Add(new ScriptReference("")); break;
        //    default: break;
        //}
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
               
            </asp:ScriptManager>
            <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
                <asp:ListItem Value="0">View 1</asp:ListItem>
                <asp:ListItem Value="1">View 2</asp:ListItem>
                <asp:ListItem Value="2">View 3</asp:ListItem>
            </asp:DropDownList><br />
            <hr />
            <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
                <asp:View ID="View1" runat="server">
                    Now showing View #1<br />
                   
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><strong> </strong>
                    <asp:Button ID="Button1" runat="server" Text="Button" /></asp:View>
                <asp:View ID="View2" runat="server">
                    Now showing View #2<br />
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="http://www.asp.net">HyperLink</asp:HyperLink>
                    <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="http://www.asp.net">HyperLink</asp:HyperLink></asp:View>
                <asp:View ID="View3" runat="server">
                    Now showing View #3<br />
                    <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
                </asp:View>
            </asp:MultiView></div>
    </form>
</body>
</html>

Q2:

paradoxperfect

Also, on EACH of the button's Load events, do someting (at least in VB.NET) like Response.Write("Hello") or the time. You will see that it will be written for BOTH controls independent of the view that is loaded. It initializes / loads the controls, but doesn't render them. And that is wasting a lot of resources.

A2:

Base on my experience, you'd better use several pages instead of "MultiView" if you care much about performence.

See this code:

<%@ Page Language="C#" AutoEventWireup="true" %>

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

<script runat="server">
    string pageURL = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        pageURL = "http://www.asp.net";// you logic code here
        //pageURL=page1.aspx
        //pageURL=page2.aspx
        //pageURL=page3.aspx
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>IFrame</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <iframe id="pages" src="<% =pageURL %>" frameborder="0" scrolling="no" width="800px" height="600px"></iframe>
        </div>
    </form>
</body>
</html>

Please correct me if I have misunderstood your mean, please LET ME KNOW, Thanks, 
Hope it helps,
Hong Gang

 

 

Thanks for the reply. But the advantage of using the MultiView control is to create only one page but have multiple "views" of the page. For example, a main list page, and then an "edit" page and then a "create" page. And then it can be easily managed with the MultiView control code-wise. I do like your idea of registering the Javascript separately which is what I need: I don't want certain JS files to be loaded when the page loads. But what I can do is control this when the multiview changes views. Thanks for pointing that out. But, it'd still be nice to have some sort of "multi-view" control that only initializes AND renders (not have it initialize and load the controls and then not render them if they're not in the view) the controls that are only in the current active "view".

 What about creating some sort of inherited MultiView control that STOPS this action. Could you think of any ways to accomplish this? Thanks for all your help!
 

If Not Page.IsPostBack Then
            MultiView1.Visible = False
        End If


This ensures that if the page is active and multiview is being called upon it wont disappear

I hope this is what you were asking for!


thanks


Deepesh

Please mark as anwer if it solved your question!

how about remove the dataload method from page_load and call it from the mainpage before you set the currentview.visibility = true

[RESOLVED] ERROR IN MASTER PAGE

I have drag and drop Script manager and update panel in master page.....

I have add code like this in master page.... here i am not showing full code i am showing only the main content where i am getting error....

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MainMasterPage.master.cs" Inherits="MasterPages_MainMasterPage"%>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp"%>

<div class="main">

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

<asp:ContentPlaceHolder ID="MainContent" runat="server">

</asp:ContentPlaceHolder>

</ContentTemplate>

</asp:UpdatePanel>

</div>

here i am getting errors like this

unknown server tag 'asp:ScriptManager'

unknown server tag 'asp:UpdatePanel'

Same script manager and update panel if i will add in content page i am not getting any errors ....

why is it so? Plz help me to resolve this errors ?

Thanks in advance.....

please try to add in Web.config.

so you can access this in every page.

 

<system.web>
......
 <pages>
                        ...
                        <controls>
                                        <add assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagPrefix="cc1" />
                        </controls>
                </pages>

On a master Page You can't inser any thing

to content place holder you can use it

and also on the page which contain that master page there you can use it

make sure this component System.Web.Extensions.dll  is installed in  ur machine...

Hi,

Simply use

        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
should be inside a form tag.

follow the link: http://msdn.microsoft.com/en-us/library/bb398864.aspx

you can also use ScriptManagerProxy (search for it on google)

Thanks,
ashish fugat.

i AM not understanding what u r telling ....

I have used that in web.config file but still i am not able to resolve those errors....

Hello,

After adding the tag in web.config if you still not get the ajaxcontrol then restart your Visul Studio then check again.

let me know it works in content or not if it works then take one more matser page and check ajaxcontrol coming (in this mater page) or not?

[RESOLVED] ObjectDataSource 'Clubs' could not find a non-generic method 'ChangeClub' that has parameters

Hi All,

I hope someone can help me cause I am about to give up on ASP.net programming for good here. Never in my life hae I had trivial crap like this mess me around so much.

I have a FormView control linked to an ObjectDatasource, in turn linked to a Dataset. I have recreated this FormView like a hundred times by now, each time linking the damn thing to a Method I created in the TableAdapter. I checked ALL the parameters and this same method works on a few other pages inmy site, but for some some inexplicable reason, this specific form keep kicking out this error:

ObjectDataSource 'Clubs' could not find a non-generic method 'ChangeClub' that has parameters...

What must I do? Here is my page's code:

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="MyClub_update_profile.aspx.vb" Inherits="Clubs_MyClub_update_profile"  EnableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="../styles/styleHomePage.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style3
        {
            width: 461px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="homepage_content">
        <div class="page_title">
            Update Club Profile
        </div>
        <div class="page_body">
            <p>Use this section to update your current active Club's Information<asp:ScriptManagerProxy
                    ID="ScriptManagerProxy1" runat="server">
                </asp:ScriptManagerProxy>
            </p>
            <asp:Button ID="btnBackToProfile" runat="server" Text="Return to Profile" />
            <br />
            <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True"
                AutoGenerateRows="False" DataKeyNames="CLUB_ID" DataSourceID="Clubs"
                Height="50px" Width="245px">
                <Fields>
                    <asp:BoundField DataField="CLUB_ID" HeaderText="CLUB_ID" InsertVisible="False"
                        ReadOnly="True" SortExpression="CLUB_ID" />
                    <asp:BoundField DataField="CLUB_NAME" HeaderText="CLUB_NAME"
                        SortExpression="CLUB_NAME" />
                    <asp:BoundField DataField="CLUB_ADDRESS" HeaderText="CLUB_ADDRESS"
                        SortExpression="CLUB_ADDRESS" />
                    <asp:BoundField DataField="CLUB_OWNER" HeaderText="CLUB_OWNER"
                        SortExpression="CLUB_OWNER" />
                    <asp:BoundField DataField="CLUB_EMAIL" HeaderText="CLUB_EMAIL"
                        SortExpression="CLUB_EMAIL" />
                    <asp:BoundField DataField="CLUB_PHONE" HeaderText="CLUB_PHONE"
                        SortExpression="CLUB_PHONE" />
                    <asp:BoundField DataField="CLUB_WEBSITE" HeaderText="CLUB_WEBSITE"
                        SortExpression="CLUB_WEBSITE" />
                    <asp:BoundField DataField="USERNAME" HeaderText="USERNAME"
                        SortExpression="USERNAME" />
                    <asp:CheckBoxField DataField="ACTIVE" HeaderText="ACTIVE"
                        SortExpression="ACTIVE" />
                    <asp:BoundField DataField="PROVINCE_ID" HeaderText="PROVINCE_ID"
                        SortExpression="PROVINCE_ID" />
                    <asp:BoundField DataField="REGION_ID" HeaderText="REGION_ID"
                        SortExpression="REGION_ID" />
                    <asp:BoundField DataField="STYLE_ID" HeaderText="STYLE_ID"
                        SortExpression="STYLE_ID" />
                    <asp:BoundField DataField="CLUB_OWNER_ID" HeaderText="CLUB_OWNER_ID"
                        SortExpression="CLUB_OWNER_ID" />
                    <asp:BoundField DataField="CITY_ID" HeaderText="CITY_ID"
                        SortExpression="CITY_ID" />
                    <asp:BoundField DataField="COUNTRY_CODE" HeaderText="COUNTRY_CODE"
                        SortExpression="COUNTRY_CODE" />
                    <asp:BoundField DataField="Province" HeaderText="Province" ReadOnly="True"
                        SortExpression="Province" />
                    <asp:BoundField DataField="Region" HeaderText="Region" ReadOnly="True"
                        SortExpression="Region" />
                    <asp:BoundField DataField="Style" HeaderText="Style" ReadOnly="True"
                        SortExpression="Style" />
                    <asp:BoundField DataField="City" HeaderText="City" ReadOnly="True"
                        SortExpression="City" />
                    <asp:BoundField DataField="PHOTO_ID" HeaderText="PHOTO_ID"
                        SortExpression="PHOTO_ID" />
                    <asp:CommandField ShowEditButton="True" />
                </Fields>
            </asp:DetailsView>
            <asp:ObjectDataSource ID="Clubs" runat="server" DeleteMethod="DeleteClub"
                InsertMethod="CreateClub" OldValuesParameterFormatString="original_{0}"
                SelectMethod="GetUserClubs" TypeName="ClubsTableAdapters.tblClubsTableAdapter"
                UpdateMethod="ChangeClub">
                <DeleteParameters>
                    <asp:Parameter Name="Original_CLUB_ID" Type="Int32" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="CLUB_NAME" Type="String" />
                    <asp:Parameter Name="CLUB_ADDRESS" Type="String" />
                    <asp:Parameter Name="CLUB_OWNER" Type="String" />
                    <asp:Parameter Name="CLUB_EMAIL" Type="String" />
                    <asp:Parameter Name="CLUB_PHONE" Type="String" />
                    <asp:Parameter Name="CLUB_WEBSITE" Type="String" />
                    <asp:Parameter Name="USERNAME" Type="String" />
                    <asp:Parameter Name="ACTIVE" Type="Boolean" />
                    <asp:Parameter Name="PROVINCE_ID" Type="Int32" />
                    <asp:Parameter Name="REGION_ID" Type="Int32" />
                    <asp:Parameter Name="STYLE_ID" Type="Int32" />
                    <asp:Parameter Name="CLUB_OWNER_ID" Type="Int32" />
                    <asp:Parameter Name="City" Type="Int32" />
                    <asp:Parameter Name="Country" Type="String" />
                </InsertParameters>
                <SelectParameters>
                    <asp:ProfileParameter Name="User" PropertyName="UserName" Type="String" />
                </SelectParameters>
                <UpdateParameters>
                    <asp:Parameter Name="ClubName" Type="String" />
                    <asp:Parameter Name="ClubAddress" Type="String" />
                    <asp:Parameter Name="ClubOwner" Type="String" />
                    <asp:Parameter Name="ClubEmail" Type="String" />
                    <asp:Parameter Name="ClubPhone" Type="String" />
                    <asp:Parameter Name="ClubWebsite" Type="String" />
                    <asp:Parameter Name="ClubUserName" Type="String" />
                    <asp:Parameter Name="Active" Type="Boolean" />
                    <asp:Parameter Name="ProvinceID" Type="Int32" />
                    <asp:Parameter Name="RegionID" Type="Int32" />
                    <asp:Parameter Name="StyleID" Type="Int32" />
                    <asp:Parameter Name="CityID" Type="Int32" />
                    <asp:Parameter Name="Country" Type="String" />
                    <asp:Parameter Name="Photo" Type="Int32" />
                    <asp:Parameter Name="Club" Type="Int32" />
                </UpdateParameters>
            </asp:ObjectDataSource>
            <br />
            
                                    
            

            <br />
        </div>
        <div class="page_footer">
            
        </div>
    </div>
</asp:Content>

 

<asp:ObjectDataSource ID="Clubs" runat="server" DeleteMethod="DeleteClub"
                InsertMethod="CreateClub" OldValuesParameterFormatString="original_{0}"
                SelectMethod="GetUserClubs" TypeName="ClubsTableAdapters.tblClubsTableAdapter"
                UpdateMethod="ChangeClub">

replace : original_{0} with {0}

Hi Baq,

Tried that, but it did not work? Is there somehting else I can try?

I also don't understand... This used to work throughout my entire site, but now all of a sudden NONE of my FormView, DetailsViews or anything else wants to Update/Create records any longer. I get this same error for everything.

Hi,

Deyken

This used to work throughout my entire site, but now all of a sudden NONE of my FormView, DetailsViews or anything else wants to Update/Create records any longer. I get this same error for everything.

In order to resolved your issue, please make sure that you haven't modified your data recently firstly. Then, you can follow the link below which is similar with your issue.

http://social.msdn.microsoft.com/forums/en-US/Vsexpressinstall/thread/5b3ec51b-d92e-4c06-b516-45453a30dcf1/

Hope this will help you.