Click here to Skip to main content
15,888,461 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: horizontal menu with vertical submenu Pin
Luc Pattyn23-Nov-10 11:36
sitebuilderLuc Pattyn23-Nov-10 11:36 
QuestionAccess denied for javascript object Pin
raghvendrapanda23-Nov-10 2:02
raghvendrapanda23-Nov-10 2:02 
AnswerRe: Access denied for javascript object Pin
Not Active23-Nov-10 2:30
mentorNot Active23-Nov-10 2:30 
Questionwindow.showModalDialog Pin
chayale23-Nov-10 0:49
chayale23-Nov-10 0:49 
AnswerRe: window.showModalDialog Pin
Sebastien T.23-Nov-10 1:54
Sebastien T.23-Nov-10 1:54 
QuestionImage Preloading for image gallery Pin
Tridip Bhattacharjee23-Nov-10 0:20
professionalTridip Bhattacharjee23-Nov-10 0:20 
AnswerRe: Image Preloading for image gallery Pin
Not Active23-Nov-10 2:28
mentorNot Active23-Nov-10 2:28 
QuestionThe Hidden Field still carries the Old Value on the First postback Pin
Vimalsoft(Pty) Ltd23-Nov-10 0:11
professionalVimalsoft(Pty) Ltd23-Nov-10 0:11 
Good Day Everyone

i have a javascript function written like this


function TestForDuplicates() {

      //Make an Arrary Values of the Textboxes
      var Texboxes = new Array(); // regular array (add an optional integer
      Texboxes[0] = document.getElementById("<%= txtUnitLen1.ClientID %>").value;      // argument to control array's size)
      Texboxes[1] = document.getElementById("<%= txtUnitLen2.ClientID %>").value;
      Texboxes[2] = document.getElementById("<%= txtUnitLen3.ClientID %>").value;
      Texboxes[3] = document.getElementById("<%= txtUnitLen4.ClientID %>").value;
      Texboxes[4] = document.getElementById("<%= txtUnitLen5.ClientID %>").value;
      Texboxes[5] = document.getElementById("<%= txtUnitLen6.ClientID %>").value;
      Texboxes[6] = document.getElementById("<%= txtUnitLen7.ClientID %>").value;
      Texboxes[7] = document.getElementById("<%= txtUnitLen8.ClientID %>").value;
      Texboxes[8] = document.getElementById("<%= txtUnitLen9.ClientID %>").value;
      Texboxes[9] = document.getElementById("<%= txtUnitLen10.ClientID %>").value;
      Texboxes[10] = document.getElementById("<%= txtUnitLen11.ClientID %>").value;
      Texboxes[11] = document.getElementById("<%= txtUnitLen12.ClientID %>").value;
      Texboxes[12] = document.getElementById("<%= txtUnitLen13.ClientID %>").value;
      Texboxes[13] = document.getElementById("<%= txtUnitLen14.ClientID %>").value;
      Texboxes[14] = document.getElementById("<%= txtUnitLen15.ClientID %>").value;
      Texboxes[15] = document.getElementById("<%= txtUnitLen16.ClientID %>").value;
      Texboxes[16] = document.getElementById("<%= txtUnitLen17.ClientID %>").value;
      Texboxes[17] = document.getElementById("<%= txtUnitLen18.ClientID %>").value;
      Texboxes[18] = document.getElementById("<%= txtUnitLen19.ClientID %>").value;
      Texboxes[19] = document.getElementById("<%= txtUnitLen20.ClientID %>").value;


      //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      var btn = document.getElementById("<%= btnComplete.ClientID %>");
      document.getElementById("<%= hidDuplicate.ClientID %>").value = findDuplicates(Texboxes);
      return false;
  }


and i am using the Function on the server side like this


protected void btnComplete_Click1(object sender, EventArgs e)
{


    Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "TestForDuplicates();", true);

    if (hidDuplicate.Value == null || hidDuplicate.Value == "")
    {

        Response.Write("<script>alert('There are no Duplicaets');</script>");
    }
    else
    {
        Response.Write("<script>alert('There are Duplicate Units: " + hidDuplicate.Value + "');</script>");

    }
}


and the button is defined like this

<asp:Button ID="btnComplete" runat="server" 
                     Text="Complete" Width="83px" 
                      TabIndex="20" onclick="btnComplete_Click1" />


and the hidden field like this

<asp:HiddenField ID="hidDuplicate" runat="server" />


Now this is working fine but , lets say i have 10 textboxes, if i change the value one the first textbox to be the same as the second textbox , it means it is a duplicate, now the problem here is that the value of the hidden field does not get updated immidiately , you have to click twice to get the real value.

Thanks
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/

AnswerRe: The Hidden Field still carries the Old Value on the First postback Pin
Not Active23-Nov-10 2:25
mentorNot Active23-Nov-10 2:25 
AnswerRe: The Hidden Field still carries the Old Value on the First postback Pin
T M Gray23-Nov-10 10:15
T M Gray23-Nov-10 10:15 
GeneralRe: The Hidden Field still carries the Old Value on the First postback Pin
Vimalsoft(Pty) Ltd23-Nov-10 18:55
professionalVimalsoft(Pty) Ltd23-Nov-10 18:55 
GeneralRe: The Hidden Field still carries the Old Value on the First postback Pin
Chris Quinn30-Nov-10 3:30
Chris Quinn30-Nov-10 3:30 
GeneralRe: The Hidden Field still carries the Old Value on the First postback Pin
Vimalsoft(Pty) Ltd30-Nov-10 4:39
professionalVimalsoft(Pty) Ltd30-Nov-10 4:39 
QuestionHow to call a javascript function in content place holder when the content place holder refreshes? Pin
Varun Sareen22-Nov-10 23:09
Varun Sareen22-Nov-10 23:09 
AnswerRe: How to call a javascript function in content place holder when the content place holder refreshes? Pin
Not Active23-Nov-10 2:19
mentorNot Active23-Nov-10 2:19 
QuestionEncrypt and Decrypt Excel columns Pin
padmanabhan N22-Nov-10 16:29
padmanabhan N22-Nov-10 16:29 
AnswerRe: Encrypt and Decrypt Excel columns Pin
T M Gray23-Nov-10 10:48
T M Gray23-Nov-10 10:48 
QuestionAjaxControlToolkit.TabContainer Pin
treuveni22-Nov-10 4:47
treuveni22-Nov-10 4:47 
AnswerRe: AjaxControlToolkit.TabContainer Pin
T M Gray23-Nov-10 10:55
T M Gray23-Nov-10 10:55 
Questionfind a session value of one project in another project Pin
raghvendrapanda22-Nov-10 1:23
raghvendrapanda22-Nov-10 1:23 
AnswerRe: find a session value of one project in another project Pin
Not Active22-Nov-10 2:10
mentorNot Active22-Nov-10 2:10 
Questionhi Pin
attikhan21-Nov-10 4:09
attikhan21-Nov-10 4:09 
AnswerRe: hi PinPopular
Not Active21-Nov-10 10:35
mentorNot Active21-Nov-10 10:35 
Questioncrystal report Pin
moon201120-Nov-10 0:35
moon201120-Nov-10 0:35 
AnswerRe: crystal report Pin
thatraja20-Nov-10 0:44
professionalthatraja20-Nov-10 0:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.