Is there a way to test to see if the compare validator in JavaScript? My issue is I have a calendar extender and the clientside code calls its corresponding update. The problem lies that if the validator returns true that I don't want to the Update to occurs. Here's a snippet. function CalStartChanged() { var prm = Sys.WebForms.PageRequestManager.getInstance(); prm._doPostBack('UpdatePanel2',''); } <asp:UpdatePanel ID="UpdatePanel2" runat="Server"> <ContentTemplate> <asp:TextBox runat="server" id="txtStartDate" Width="100px" CssClass="LeftSelectionSmall"/> <img src="Images/Calendar.jpg" id="btnStartDate" alt="Choose start date." runat="Server"/> <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtStartDate" Animated="False" PopupButtonID="btnStartDate" OnClientDateSelectionChanged="CalStartChanged"/> </ContentTemplate> </asp:UpdatePanel> Protected Sub UpdatePanel2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles UpdatePanel2.Load If scriptManager1.IsInAsyncPostBack And scriptManager1.AsyncPostBackSourceElementID = "UpdatePanel2" Then dgresults.DataSource = oData.FillDataTable(StrQueryReturn(txtStartDate.Text, txtEndDate.Text, lstShift.SelectedValue, lstSpecies.SelectedValue, lstPackType.SelectedValue)) dgresults.DataBind() 'Put the sql in the cheat box CB.Text = StrQueryReturn(txtStartDate.Text, txtEndDate.Text, lstShift.SelectedValue, lstSpecies.SelectedValue, lstPackType.SelectedValue) End If End Sub
cisco2103
Posts
-
Validator extender -
UpdatePanel issueI fixed it. It was a BONEHEAD mistake that took hours for a simple placing of the update panel in the wrong position! DOHH
-
GridView - UrgentIn the rowCreated event, You can add and attribute to that cell. Example: e.Row.Cells(8).Attributes.Add("onMouseOver", "alert('do something')")
-
UpdatePanel issueI have a gridView with has a textbox in each row. When I click my adjust button I add up all the textboxes and if they don't equal 1 I set a bolean and show a alert message. This works when the page does a full postback but when I throw a updatePanel around my grid and set up triggers its doesn't and gives me a unexpected javaScript Error. Any help will be appreciated. Here's a snippet. Protected Sub btnAdjust_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdjust.Click 'Validate that the yield are 1 YieldValidation() If BolValid = False Then ScriptManager.RegisterStartupScript(Me.Page, Me.GetType, "alert", "alert('Yields must equal 1. Your total is " & yieldTotal & ".')", True) 'Page.ClientScript.RegisterClientScriptBlock(Page.GetType, "alert", "alert('Yields must equal 1. Your total is " & yieldTotal & ".')", True) End If End Sub
-
Formview IssuesI am trying to loop though the contents of a formview and depending on the control type do something. My formview doesn't pick up all the content inside of the table. Basically I am just going to have a reset button that loops through and sets the text to "". Thoughts?
Hole1
Hole2
-
HelpI am having a little problem.... I have formview and within the ItemTemplate of the formview I have a tables with different controls. I won't to be able to loop through the formview and depending on the type of control do something with it. When I loop through it, it only says there are one control which is the table... Here are some snipetts.
Score
Protected Sub btnReset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReset.Click For Each c As Control In FormView1.Controls If TypeOf c Is TextBox Then CType(c, TextBox).Text = "" ElseIf TypeOf c Is CheckBox Then CType(c, CheckBox).Checked = False End If Next End Sub
-
Drag and Drop Between ListboxesHas anyone found any documentation on how to drag and drop between two list boxes? Preferrably with AJAX. Any help would be greatly appreciated. Thanks, Cisco2103
-
radio buttonsYou have them set to the same group. You can only have one button checked per group. Is that what you are trying to do? I guess I am confused by what you are asking.
-
Is this Querystring?Yes it is querystring.. It is the index page of the test folder's query string. Make sense?
-
Checkboxes within a grid [modified]I have been assigned a project where I need to show a check box in a grid that is based off of a bit field in a sql database. Here is what I am trying to do but not working correctly. Is there a better way to do this? Thanks, Cisco2103 -- modified at 10:23 Friday 5th October, 2007 DUH I fixed it. Thanks
-
TreeView that Updates a gridI have been assigned a project that needs a treeView that shows documents listed in a grid. Example: When a root node is selected it would show all the documents... A parent node is selected it shows all the documents listed under that parent... A child node is selected then is shows all doc under that child. I have done extensive research on this and havne't found anything that I'm looking for. Any help or suggestions would be great. Thanks Cisco2103
-
Dynamic Images in a GridI am populating an Grid for a db and one of the fields is a bit field called attachments. I would like to populate an attachment icon if the value is 1. Thoughts......
-
dataFormatString with UpdatePanelFor some reason when I have a Update Panel around a grid and try using a dataFormatString it doesn't work. My code is correct because I have used it before without an updatePanel. DataFormatString="{0:MM-dd-yyyy}" Any thoughts
-
TreeView Issue with AJAXI have a treeView and based on the Node Selected I populate a grid. I have my asyncPostback set to Collaspe and Expand events. The code fires Correctly but the JavaScript attached to the Node doesn't fire. Is there a way around this with out having it post completely back?
-
TreeView IssueHas anyone came across a solution on how to hide the root node in a TreeView?
-
FormView IssueNot quite what I was looking for. I do have a datasource and what not but I am looking for a better way to grab the actualy entered data without having to declare 2 variables (Textbox and a integer) just to get the data from the formview.
-
FormView IssueI am creating a golf Application to keep track of my stats and I am using a formview. Is there a better way to do this... Private Sub GetPutts() Dim txtPuttOne As TextBox = Me.FormView1.FindControl("txtPuttsHoleOne") Dim intPuttOne As Integer = CInt(txtPuttOne.Text) Dim txtPuttTwo As TextBox = Me.FormView1.FindControl("txtPuttsHoleTwo") Dim intPutttwo As Integer = CInt(txtPuttTwo.Text) Dim txtPuttThree As TextBox = Me.FormView1.FindControl("txtPuttsHoleThree") Dim intPuttThree As Integer = CInt(txtPuttThree.Text) Dim txtPuttFour As TextBox = Me.FormView1.FindControl("txtPuttsHoleFour") Dim intPuttFour As Integer = CInt(txtPuttFour.Text) Dim txtPuttFive As TextBox = Me.FormView1.FindControl("txtPuttsHoleFive") ***all the way to Hole 18 Try dsPutts.InsertCommand = "INSERT INTO [dbo].[Putt_Info] " dsPutts.InsertCommand += "([CourseId] ,[UserId],[ScoreID],[PuttsHoleOne]," dsPutts.InsertCommand += "[PuttsHoleTwo],[PuttsHoleThree],[PuttsHoleFour]," dsPutts.InsertCommand += "[PuttsHoleFive],[PuttsHoleSix] ,[PuttsHoleSeven]," dsPutts.InsertCommand += "[PuttsHoleEight],[PuttsHoleNine],[PuttsHoleTen]," dsPutts.InsertCommand += "[PuttsHoleEleven],[PuttsHoleTwelve],[PuttsHoleThirteen]," dsPutts.InsertCommand += "[PuttsHoleFourteen],[PuttsHoleFifteen],[PuttsHoleSixteen]," dsPutts.InsertCommand += "[PuttsHoleSeventeen] ,[PuttsHoleEighteen])" dsPutts.InsertCommand += "VALUES('" & courseID & "', '" & Session("UserName") & "', '" dsPutts.InsertCommand += Session("ScoreID") & "'," & intPuttOne & "," & intPutttwo & "," & intPuttThree & "," & intPuttFour & "," & intPuttFive & "," & intPuttSix & "," & intPuttSeven dsPutts.InsertCommand += "," & intPuttEight & "," & intPuttNine & "," & intPuttTen & "," & intPuttEleven & "," & intPuttTwelve & "," & intPuttThirteen dsPutts.InsertCommand += "," & intPuttFourteen & "," & intPuttFifteen & "," & intPuttSixteen & "," & intPuttSevenTeen & "," & intPuttEighteen & ")" dsPutts.InsertCommandType = SqlDataSourceCommandType.Text dsPutts.Insert() Catch ex As Exception Response.Write(ex) End Try End Sub I basically just want to grab the text the user enters in each of the controls and then insert it into the database. Thanks in advance
-
UpdatePanel with Radio buttonsAny ever have any trouble using an updatePanel with RadioButtonLists? I am getting it to update once without posting back to the server using async postback but once I click on the other radiobutton it doesn't run the same set of code again. If you know of any articles to read that would be great! Thanks, Cisco
-
Interesting question about TestingIs there a way to find out what a user's default Media player is? We are running into a instance where Windows Media Player acts different that QuickTime Media player where WMP opens up in a new window to where QT opens up in the current window. Any kind of insight would be great.
-
AJAX avoid using Reponse.writeI've tried putting them in the header section of the page but with no luck. Not very familiar with Init and PreInit since I am pretty new to .Net What would I accomplish by doing this?