Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

User 7763270

@User 7763270
About
Posts
17
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Trying to use age.ClientScript.RegisterHiddenField - need help
    U User 7763270

    Hi, I have a myPage.aspx page and 2 user controls, ucA and ucB. ucA (parent control) is being used in ucB (child control inherits ucA). Finallly ucB is registered in myPage.aspx. I have two dropdowns in ucB. Now, I am trying to put the selected values of these dropwdowns in a hidden variables using the below code and I am putting this in myPage.aspx page_load code Page.ClientScript.RegisterHiddenField("LabValue", labname selectedvalue using FindControl) Page.ClientScript.RegisterHiddenField("ClientValue", ClientName SelectdValue using FindControl)) The above code runs fine and no errors. Now in the exeternal .js file I am accessing this values as var lv = document.getElementById("LabValue").value; var cv = document.getElementById("ClientValue").value; All look fine. But the issue is no matter what values I put in the LabValue and ClientValue hidden fields I always get the values as 0 for lv and cv (java script variables). Say for instance if LabValue is 10002 when I try to access it via javasacript using document.getElementById("LabValue").value; I always get 0 instead of 10002. It is the same case with the other hidden field too. When I looked at the myPage.aspx viewsource I always see <input type="hidden" name="LabValue" id="LabValue" value="0" /> Am I missing some thing here? Thanks in advance, L

    JavaScript help java javascript winforms tools

  • User control - how to access the element using javascript
    U User 7763270

    I am not sure if I understand it right what you have said. Can you please re frame your idea? Yes I am using vb.net but not sure what you mean and what you want me to suggest to use or code how?

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    When I debugged and used the Request.Form("__EVENTTARGET") to see which one is causing the post back then as I thought the dropdown that had the focus is the culprit. I do not know why or couldn't figure out just because it lost the focus it is doing a post back. As you menioned with your tested example, and I did the same thing and for some reason it is doing a post back which it shouldn't as we tested it.

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    Hi, That is exactly right. It shouldn't postback just because it lost the focus. I too tested it and it doesn't happen in my test page. I couldn't figure out what the issue is but when I debug our application it loads the page twice. And when the page got loaded I when I click on any where on the page the dropdown looses the focus and it is doing a post back. It is very annoying to me. I am not sure loading the page twice, which I realized when I debugged the app is somehow may be causing this issue. I am kind of exhausted with this issues as I couldn't figure what in the world is going on to cause the page load twice. I really appreciate for replying to all my messages. If I had any luck I will post it here. Thanks again. L

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    The other way I am thinking is to set the dropwdowns.Focus() some where in one of the the page life cycle events (init, Load, validate, Event, Render, Unload) but not in the same location where it is being set right now? Even then, no matter what by the time it loads the page the dropdownlist would get the focus? Please provide if this way provides any solution to my issue.

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    I kind of figured the issue. AS I have mentioned I have two User Controls , say UC-A and UC-B. The textBox that is being refreshed is located in UC-A and this is being used by UC-B and UC-B is used by a .aspx page so that is how it is structured. The UC-B has two DropDownList controls whose AutoPostBack property set to true. And programatically it is a must to set the focus to one of these DropDowlists. So when the page is loaded the DropDownList gets focus and when I try get the focus to the textBox to type in some thing then the DropDowlist is doing a post back as its AutoPostBack property has been set to true. So I am trying to figure out a way where, if I do not change the of the selectedIndex of the dropdown and just make its focus lost then do not do a post back. I think may be I can try to come up with a javascript function where I can nullify the post back in the javascript function. Any inputs if this sounds doable?

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    I found this function on our default.master // function onCancel() { // __doPostBack('RedoPageLoad', ''); // } and commented this out but still it is still posting back.

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    I am looking at the page view source and found this javscript function function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } and I do see __doPostBack being called in so many instances. But all of those calls make sense to me say for instance it is being called like this openeing a tag.. id="ctl00_LoginStatusValue" class="headerLoginStatus" hre..="javascript:__doPostBack('ctl00$LoginStatusValue$ctl00','')">Log Out closing a tag and other instances are like for a dropdown onchange events.. like onchange="javascript:setTimeout('__doPostBack(\'ctl00$DefaultContent.... let us see what else causing it. I will keep posted when I find some thing new and or when I fixed the issue.

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    I think I am getting close to figure out what is causing the issue. I think it is the Java script that may be causing the issue. I just disable the java script (ttos/internet optionts/security and licked on custom level and disabled the Active scripting) and when I do this the value of page.ispostback doesn't change and it is always false when it loaded for the first and it doesn't change to true and the page doesn't post back. On our when we mouse over on our application tabs all the options slide down. But now that I disabled the javascript I am not seeing the options slide when I mouse over. So I had click on the tab that takes me to the page I am having page post issue with. When I enable the javascript all look good and it post back as usual. Now, how do I figure out which javascript function is causing the issue. Out application is really huge. So just to make sure I am thinking it right. Once the page, that I am having issue, loads I am thinking to view page source and try to find all the javascripts and try to find that is causing the post back. But what do I need to look in the view source for me to know which one causing the postback? I will keep at it and I need to fix it. Thanks, L

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    Hi, The idea of putting <%= Page.IsPostBack.ToString()%> on my usercontrol helped me realize that it is not the issue with the Text disappearing in the textbox. But the issue is that the page is getting post back twice and that is why the text in the text box is disappearing. When page is loaded for the first time the value of <%= Page.IsPostBack.ToString()%> is False and in few seconds a page post back is taking place all by itself and the value is true. I couldn't figure out what is causing the second post back yet. But when I searched online I found that there could be two reasons for posting back twice. 1) It may be because of any client side scripting either java script or jQuery that may be causing the post back. In my case I do not see any client side that is written to cause a post back. 2) The other reason for the second time post back could be that if any Image tags are used and then if no src attribute is provided then this might also cause a post back. In my case, we are using a default.master and I see quite a few tags are defined in the master page and I do not see either src or imageurl attribute being used in them. I just see that a skinID is being used. I am not sure if I need to use imageurl in all of my tags to fix the page post back issue Does any body have any inputs? Thanks in advance, L

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    Bob, I am running out of ideas on how to code using this approach <%= (some expression) ? "style=\"display:none\"" : "" %> /> can you please help me with some code snippet?

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    As an alternative I am also trying to use setTimeout but it doesn't seem like it is doing any difference.

    <script type="text/javascript" language="javascript">
    $(document).ready(function () {
    setTimeout(function(){
    document.getElementById('<%= SearchDoctor.ClientID%>').style.visibility=visible;
    },500);
    //alert('<%= SearchDoctorPanel.ClientID%>_TextBoxDiv');
    //document.getElementById('<%= PhoneSearch .ClientID%>').style.display = 'show';
    //document.getElementById('<%= PhoneSearch .ClientID%>').style.display = '';
    //document.getElementById('<%= SearchUpdatePanel.ClientID%>_TextBoxDiv').style.display = '';
    });
    </script>

    any inputs on this as well? Thanks, L

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    Hi Bob, Thanks for post. I am sorry I forgot to mention that I am setting my PhoneSearch text box disaplay to non as you see below but forgot to include the above code. I have tried your idea of putting it in a Div and also with out Div just setting the text box to display none and below is the code I have right now

    <script type="text/javascript"  language="javascript">
           $(document).ready(function () {
               //alert('<%= SearchDoctorPanel.ClientID%>\_TextBoxDiv');
               //document.getElementById('<%= PhoneSearch .ClientID%>').style.display = 'show';
               document.getElementById('<%= PhoneSearch .ClientID%>').style.display = '';
             //document.getElementById('<%= SearchUpdatePanel.ClientID%>\_TextBoxDiv').style.display = '';
             });
      </script>
    

    in either case what it is doing is it first shows the Textbox for few seconds and then disappear. I think I am almost there but I believe some thing to do with the styling to make it show and do not disappear. Thanks, L

    JavaScript javascript help com tools tutorial

  • User control - how to access the element using javascript
    U User 7763270

    Hi, I have a PhoneSearch textBox in UserControlA. I want to disable or do not show it. The usercontrolA is being used in another UserControlB and finally the UserControlB is being used in a Test.aspx page. Now when I load the Test.aspx page and when I type in the PhoneSearch textBox the text disappear for the first time. I think some how there is a little page refresh is taking place in the first 3 to 5 seconds. But if I wait for first 5 seconds and then type in then the text stays in the SearchTextBox. So my idea is disable or do not show the Searchtextbox for the first few seconds and I think that may be the solution for page refresh issue (please mention if there is another way we can fix this and code snippet). I am not sure why there is a page refresh is taking place when the page loads of the first time. Just as a side note the UserControlA and UserControlB both are inside an update panel and test.aspx is using a master page. I am trying to use the below code in the userControlA as below but no luck

    <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Test.ascx.vb" Inherits="...Test" %>

    <<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>

       <script type="text/javascript"  language="javascript">
           $(document).ready(function () {
               $('<%= PhoneSearch.ClientID%>').show();
               alert('<%= PhoneSearch.ClientID%>');
           });
    

    I get ctl00_DefaultContent_UserControlB_UserControlA_SearchTextBox in my alert box and the $('<%= PhoneSearch.ClientID%>').show(); doesn't show the text box. Can some one help me with this? Thanks in advance, L

    JavaScript javascript help com tools tutorial

  • varchar(max) in database - how to put the size in ADO.NET
    U User 7763270

    I tried with the Text but the same thing it can't store more than 43567 charecters. I also tried updating the Text database field that I just created for testing in the management studio but no luck. For some unknown reason it is storing only 43567 charecteros of text. Any inputs towards fixing this issue is greatly appreciated. Thanks, L

    C# help csharp database tutorial

  • varchar(max) in database - how to put the size in ADO.NET
    U User 7763270

    Hi, I have field in database and it is defined as Varchar(max). And in the front in ADO.NET I am trying with the options AddParamToSQLCmd(sqlCmd, "@Comments", SqlDbType.VarChar, -1, ParameterDirection.Input, pArg.Comments); SqlDbType.NVarChar, -1 SqlDbType.VarChar, -1 SqlDbType.NText, -1 and nothing seemed working. I am trying to insert over some 48000 charecters but it is storing only 43500 some charecters. Not sure if I am missing some thing. Am I doing it right or can some one please help me how to get around this issue. Thanks in advance L

    C# help csharp database tutorial

  • How to reference the loaded instance of Class A in Class B
    U User 7763270

    Hi, I have two classes say Class A and Class B. I am trying to find how do I get reference the loaded instance of Class A in Class B. I do not want to get a new instance of Class A. I want to be able to reference to the loaded instance and use the loaded methods and properties. Class A { ... Class A myClass = New Class A(); ... ... Class B clsb = New Class B(); clsb.DoSomething(int a, int b) } Class B { ... public void DoSomething(int a, int b) { .... //I want to be able to reference to the loaded instance which is 'myClass' of the Class A. (not a new instance) } } Can some one please help me with this. Thanks, L .

    C# help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups