Hello, Thank you for reading. Here is my situation. I have a masterpage with a tablerow that has a few webuser controls inside of <td>. one of my content page is a gridview with item templates,on clicking on a row it shows up a AJAX modalpopup with a button and on click and increments count by 1 in a database table. The webuser control mentioned above gets the count from the db and displays the count. For example when the user first comes in for example, lets say the webusercontrol A shows -Hello XYZ, you have 2 items in your shopping cart. Then the user goes to my page with the gridview and clicks on an item and says add to cart. This would increment in the db the count to 3. I want the webuser control in my masterpage to get this value immediately and display -You have 3 items in your shopping cart. How can I achieve this with updatepanels and how do i trigger a postback for the webusercontrol in my masterpage? All help is greatly appreciated, if you have any code samples or links that do something similar that would be wonderful !! Thanks RH
Ridge Howison
Posts
-
Masterpage control update -
SelectedIndexChanged Event for Dropdownlist AJAXHello, Thank you for reading. Here is my situation. I have an UpdatePanel and within in I have 2 dropdownlists. I want to show the second ddlist only when a specific value is chosen in dropdownlist1. I used Javascript/label etc on the selectedIndexChanged event but still does not work. The event gets fired and I stepped thru the code with no problems but it does not render on screen. Code snippet below. All help is wonderfully,gratefully and thankfully appreciated. Front End <asp:UpdatePanel ID="updPanel1" runat="server"> <ContentTemplate> <asp:DropDownList ID="ddlTest1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlTest1_IndexChanged"> <asp:ListItem Value="" Text="Select one"></asp:ListItem> <asp:ListItem Value="Matt" Text="Matt"></asp:ListItem> <asp:ListItem Value="Robin" Text="Robin"></asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="ddlTest2" runat="server" style="visibility:hidden;display:none;"> <asp:ListItem Text="Select One" Value=""></asp:ListItem> <asp:ListItem Text="Tom" Value="Tom"></asp:ListItem> <asp:ListItem Text="John" Value="John"></asp:ListItem> </asp:DropDownList> </ContentTemplate> </asp:UpdatePanel> And the Codebehind is as follows: Protected Sub ddlTest1_IndexChanged(ByVal sender As Object, ByVal e As EventArgs) If ddlTest1.SelectedValue = "Robin" Then Dim script As String = "<script type='text/javascript'>var elem=document.getElementById('" & Me.ddlTest2.ClientID & "');elem.style.visibility='visible';elem.style.display='block';</script> Page.ClientScript.RegisterClientScriptBlock(Me.GetType()
-
Gridview AJAX hovermenu problemHello, Thank you for reading this post. Here is my situation. I am new to AJAX development. I have a gridview with 4 boundfield columns and 1 buttonfield column. I need to display a popup anytime a user hovers over the buttonfield column and popup a panel which has some database driven text and a button which says "Add this to my plan" and a cancel button on the popup. How do i associate a hovermenu extender to a buttonfield column with targetcontrolid? Does the hovermenu controller need to be associated in the rowcommand of the gridview? How does this need to be done. A code sample or a URL where someone has already done this will help my cause mightily ! Here is the code of what I have <asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional"> <ContentTemplate> <ASCPWebC:GridView ID="gvProducts" runat="server" DataSourceID="odsProducts" OnRowDataBound="RowDataBound" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" CssClass="datatable" CellPadding="0" CellSpacing="0" BorderWidth="0" GridLines="None" >
-
AJAX Hovermenu on Gridview button fieldHello, Thank you for reading this post. Here is my situation. I am new to AJAX development. I have a gridview with 4 boundfield columns and 1 buttonfield column. I need to display a popup anytime a user hovers over the buttonfield column and popup a panel which has some database driven text and a button which says "Add this to my plan" and a cancel button on the popup. How do i associate a hovermenu extender to a buttonfield column with targetcontrolid? Does the hovermenu controller need to be associated in the rowcommand of the gridview? How does this need to be done. A code sample or a URL where someone has already done this will help my cause mightily ! Here is the code of what I have <asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional"> <ContentTemplate> <ASCPWebC:GridView ID="gvProducts" runat="server" DataSourceID="odsProducts" OnRowDataBound="RowDataBound" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" CssClass="datatable" CellPadding="0" CellSpacing="0" BorderWidth="0" GridLines="None" > <Columns> <asp:BoundField DataField="FieldA" HeaderStyle-CssClass=
-
AJAX HelpHello All, Thank you for reading this post. I am new to AJAX development. Here is my situation. I have a masterpage that has 3 image buttons. On clicking on each it should show the content page in the contenttemplate without a postback.So it is dynamic and show the latest and greatest page.So clicking imageA should show pageA.aspx, clicking imageB should show pageB.aspx and so forth without a postback. Ofcourse all the content pages will inherit from this master page. How do i go about it? Code examples/sample websites would help immensely ! please note, i am a .NET 2.0 developer making the jump to .NET 3.5 and AJAX. So a total newbie. Regards RH
-
Forms Authenticationcouple of things. 1.check if the forms auth cookie is being set after you login. 2. try response.redirect("Another_one_page.aspx",false);
-
Query StringYou need to make sure the querystring is URL Encoded. I use the following function that i find useful Public Function Encrypt_UrlEncode(ByVal textToEncrypt As String) As String Try Return System.Web.HttpUtility.UrlEncode(textToEncrypt, System.Text.Encoding.Default) Catch ex As Exception Throw ex End Try end function In your code before you redirect do something like this Dim queryString as string=Encrypt_UrlEncode(WhatEverStringYouWantToPassAsQueryString) response.redirect("http://www.abc.com/RedirectPage.aspx?Q=" & queryString) Good Luck RH
-
Javascript Issue -Not working in FirefoxThank you for reading this post. I am new to Javascript and ASP.NET development so please bear with me. I have a page that renders fine in IE but the same functionality gives me error in Firefox. I have a form which has a bunch of check boxes and there is a a particular checkbox lets call it ABC, and clicking on it, it needs to uncheck the other boxes, and if other check box is clicked, it shud uncheck the the ABC checkbox. The checkbox are created dynamically through code in a table cell. My app works fine in IE but not in Firefox. I know there are a few keywords that is Microsoft proprietary, and is not all browser friendly, but i cannot figure out how to change it. Here is my code below. All help is appreciated. the error I get in Firefox and Safari when I click on any checkbox is ctrl.ParentElement has no properties. All help and code sample/corrections are appreciated. Please note: I am a systems support guy who has to maintain pages. function ValidateCheckedValues( ctrl , isChecked ) { // Purpose : This function is called when the user clicks on any checkbox in the equipment requirements table on the page // If the user clicks on the "ABC" checkbox it clears all the check boxes for that meeting, // but if the user checked any other checkbox, it removes the check from the "ABC" checkbox try { if( ctrl.parentElement.attributes("SubCode").value == "NONE" ) { if( isChecked ) { for( counter = 3 ; counter < ctrl.parentElement.parentElement.parentElement.children.length ; counter++ ) { ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).children( 0 ).checked = false; } ctrl.checked = true; } } else { if( isChecked ) { for( counter = 3 ; counter < ctrl.parentElement.parentElement.parentElement.children.length ; counter++ ) { if( ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).attributes("SubCode").value == "NONE" ) { ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).children( 0 ).checked = false; } } } } }
-
Mozilla firefox issue.please note:this works fine in IE but throws errors like ctrl.parentElement has no properties.Please let me know what error is happening here. I changed the parentElement to parentNode and the children to childNodes but it just will not work for firefox. Iam a Software support person so do not have an indepth handle on the workings of .NET or Javascript. Thank you.
-
Mozilla firefox issue.Hello, Thank you for reading this post. I am new to Javascript and ASP.NET development so please bear with me. I have a page that renders fine in IE but the same functionality gives me error in Firefox. I have a form which has a bunch of check boxes and there is a a particular checkbox lets call it ABC, and clicking on it, it needs to uncheck the other boxes, and if other check box is clicked, it shud uncheck the the ABC checkbox. My app works fine in IE but not in Firefox. I know there are a few keywords that is Microsoft proprietary, and is not all browser friendly, but i cannot figure out how to change it. Here is my code below. All help is appreciated. function ValidateCheckedValues( ctrl , isChecked ) { // Purpose : This function is called when the user clicks on any checkbox in the equipment requirements table on the page // If the user clicks on the "ABC" checkbox it clears all the check boxes for that meeting, // but if the user checked any other checkbox, it removes the check from the "ABC" checkbox try { if( ctrl.parentElement.attributes("SubCode").value == "NONE" ) { if( isChecked ) { for( counter = 3 ; counter < ctrl.parentElement.parentElement.parentElement.children.length ; counter++ ) { ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).children( 0 ).checked = false; } ctrl.checked = true; } } else { if( isChecked ) { for( counter = 3 ; counter < ctrl.parentElement.parentElement.parentElement.children.length ; counter++ ) { if( ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).attributes("SubCode").value == "NONE" ) { ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).children( 0 ).checked = false; } } } } } catch( ex ) { alert( ex.message ); } }
-
Forms AuthenticationHello All, Thanks for reading this post. Here is my question. One of the development teams in my company is building the company website using ASP.NET. My team is building an ASP.NET website which part of the website. My app is going to reside as an application folder inside the main app. Iam using forms authentication for my site. One of the requirements is after performing login into the main site, if the user clicks on a particular link it should log the user directly onto my site as well(Single Sign On). However much I try, on clicking on the link on the main page, it always goes to the logon page on my application because of forms authentication. How can i use forms auth to sign the user into my application and go directly to the page. The user id is stored in a cookie. Can i create a basepage which actually does the forms auth and pages inherit from it?? I have explained the scenario in very simple terms and it is more complicated than this. Basically this is what i want to do...lets say my site is www.abc.com i log in...and reach page abc.com/A.aspx ...i click on a link which will needs to take me to abc.com/appFolder/C.aspx....but when I do this, I always go to abc.com/appFolder/B.aspx which is the login page for appFolder(forms auth).. plz help...sample code highly appreciated. Thanks RH
-
XML help !thank you !!!!
-
XML help !Hello, Thank you for reading. Here is my situation. I have a web service that takes as input user name and password, that returns an xml document..if all credentials match the document contains info about the user something like this 123456 Tester Abc Tester Abc else it has Invalid Login when I get the xml document in my application, how can I check if is present in the xml document? Also I want to get the value of the error as string. Please Help RH
-
Forms Authentication Help !Hello !! Thank you for reading this post. Here is my problem. I have build a website that uses forms authentication.So there is a login page..you need to enter your login pwd and this is checked against a database and if authenticated is shown a welcome page. Also if i copy the url of a protected page, it will redirect to the login page and on successful login it will redirect to the requested page. All works fine. Here is my problem I need to integrate my site with the site of a vendor. My site shall be put inside an application folder under the vendor site. I cannot modify his web.config..i can add common classes and dlls though. I shall be giving the login component as a web user control to the vendor, this login is slightly different than my login page.On entering login and pwd, it checks against my db and if valid...it shows a welcome message inside the login control on a label and replaces the login/pwd boxes with a panel containing links to pages inside my app.On clicking on the links, it should redirect to my pages without a hitch. How will my forms authentication on my login page inside the vendor application directory know the user has been authenticated ? What stops it from showing the login page to the User? Please help !!! your comments are most appreciated !! a sample code or a link which can explain this wud be most appreciated !! Thanks RH
-
Datagrid questionHello, Thank you for reading this post. Here is my question. I have a datagrid and have 5 columns in it.The first one being should be a button column(either a button column or a template column with button is fine). The second column is lets say Email Subject, 3rd column is email date, 4th column hidden is customer_id and 5th column is email_sequence_id which is also hidden. My problem is this. When I click on the button in the datagrid i need to open a new window and go to a aspx page lets say showemail.aspx?id=custid&email_sequence_id=sequenceid where custid=column 4 of the datagrid and sequenceid=column 5 of the datagrid for that row. And this needs to open up in a new browser window. How do i do it ?? I tried using javascript and didnt work. Any suggestion will help. Please also be kind enough to give me a code sample because iam a little new to ASP.NET Thank you for reading RH
-
Back button issueWill the above solution solve my issue ? Iam using VB.NET for my coding not C#
-
Back button issueHello All, Thank you for reading this post. Here is my issue. I have an ASP.NET 2.0 web application, that requires users to login and then they are shown the welcome page on successful login(Iam not using forms authentication, user's login credentials are validated against database and redirected to welcome page). The Welcome page has a logout button, on clicking which I clear all session variables, destroy all login based cookies and redirect to the login screen again. My problem is this. After I logout and reach the Login page if I hit the back button I go back to my welcome screen with all user information even though I have explicitly cleared session and cache. Please let me know how I can enforce the login page when back button is pressed. This is what i have on my logout page. Protected Sub lkbLogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lkbLogout.Click Session(CustomerInformation) = Nothing Session.Clear() 'Remove all cookies If Not Request.Cookies(ConfigurationManager.AppSettings("Cookie")) Is Nothing Then Response.Cookies(ConfigurationManager.AppSettings("Cookie")).Expires = DateTime.Now.AddYears(-30) End If If Not Request.Cookies(ConfigurationManager.AppSettings("Cookie2")) Is Nothing Then Response.Cookies(ConfigurationManager.AppSettings("Cookie2")).Expires = DateTime.Now.AddYears(-30) End If If Session(CustomerInformation) Is Nothing Then Response.Cache.SetCacheability(HttpCacheability.NoCache) Response.Cache.SetExpires(DateTime.Now - New TimeSpan(1, 0, 0)) Response.Cache.SetLastModified(DateTime.Now) Response.Cache.SetAllowResponseInBrowserHistory(False) Response.Redirect("login.aspx", True) End If '------------------ response.redirect("login.aspx",true)
-
datagrid issueThank you...I think that works fine. I created a template column and added a div with overflow property set to auto. That ensured whenever length or width went beyond, it would add scroll bars. works great. Thanks
-
datagrid issueHello, Thanks for reading this post. Here is my issue. I have a datagrid which 5 bound columns(3 of which are not visible) and 1 button column. Column 1 is date of operation, column 2 is text of email sent by my company etc. My issue is i want to display the entire content of the email text(which can be 2000 characters) inside the cell and have a scroll bar inside the cell, so the page does not become too big. For each row i would like to see the Date, The text of the email and if it exceeds the height of the row, then have a scroll bar within the email text column. How can I do that ?? All help is most appreciated !! This is what i have now.
-
Datagrid helpHello All, Thanks for reading this. Here is my issue. I have a datagrid which needs to show 3 columns from my database stored procedure. Lets say the stored proc returns a dataset with 3 columns A,B,C. In my datagrid I want to show columns A and B and keep column C invisible. No big deal right ? Okay here is the tricky part. If value of the data row for column C="General" then i want to make the entire row color Red(or the text color to turn red preferably) for that record.If the value of column C="Personal" i want the rowtext to remain black..but now i want to show a "Delete" hyperlink there, lets say clicking on it makes it go to another page.The "delete" hyperlink should not appear when the column C value is "General". I know the "Delete" hyperlink we can add as a column which is not visible, but cannot seem to figure the mechanics of it. How do I go about it ? All help is greatly appreciated. Code samples much more appreciated !!! Regards RH