.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

JqGrid enter infinitive loop when trigger reloadGrid

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :ASP.Net

Hi guys,

I am using the JqGrid in my application and in one page I use the setGridParam to change the url and then call the trigger("reloadGrid") method. If the result json response is empty (no row data) my code end up in an infinitive loop reloading the grid. I have checked the gridComplete event and its not triggering the reload. Have any off you guys seen this before or know anything about it?


View Complete Post

More Related Resource Links

detect enter keypress and trigger button click (all browsers)


I have some textbox's that when the enter key is pressed on them, i should fire a buttons action (say the go button).

Seems that it no longer works accross current browsers and  i was wondering if anyone has some nice javascript or something to detect if enter is pressed and fire a button click action (accross all current browsers - ie8, ff, safari, chrome etc)

Microsoft's Collaborative Application Markup Language (CAML) Loop

discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

JQGrid Loading deleted values



This is quite strange. here is the issue:

Some Info:

1. I'm using a multi-select jqgrid.

2. I have my own delete button to delete multiple orders

The problem:

When i press the delete button on the pager of my jqgrid, the records are deleted from the database but JqGrid shows some records (4-5). On refreshing the grid, correct numbers of records are shown.

Here is the code:

function delorder() {
        var amg = $("#horder").getGridParam('selarrrow');
        var cont = amg.length;
        if (amg.length > 0) {

Using a trigger or anything else to populate two tables


Hi! I'm creating an application that's supposed to first add a record to table1, and then get the ID from that record to use when adding a record to table2, to be able to associate these two records with eachother.

The user gets to type in some values that goes to table1, and some values that goes to table2, but before the insert statement for table2 is executed i need the ID from the recently added record in table1. Some dude told me to use a trigger for the autopopulate purpose, but does that really work when i also need to save some values that's user input, and when those values doesn't get saved in table1?

Are there any other way to do this or can i send values to a trigger? I'm new to triggers and stored procedures, i don't have any particular knowledge of this, any help is appreciated!


Regards, Monsterbadboll

how to get id value from the row inserted in a table with thr trigger.


I have a reports table with column report id and and report version. I created a trigger on this table to execute an application to do some processing each time a row is inserted in reports table. I need to pass the new report id execute this application from the trigger. How do I get the report id from the row that was inserted?


for each loop



Need help in for each loop. i'm poor in for each loop. i wanna create a for each loop that can give me 2 value in each rows.

i create a for loop.. but is a mulitple rows. Anyone can help ?

here is my code.

Dim x As Integer, y As Double, x1 As Integer

        Dim d As Date, prevD As Date
        Dim d1 As TimeSpan

        temp_sec = ac.getTempTime(ddl_date.SelectedValue, ddl_id.SelectedValue)

        For I As Int32 = 0 To temp_sec.Tables(0).Rows.Count - 1
            If I Mod 1 = 0 Then
                ' To prevent list out of bounds
                If I + 1 < temp_sec.Tables(0).Rows.Count Then
                    d = temp_sec.Tables(0).Rows(I).Item(0)
                    prevD = temp_sec.Tables(0).Rows(I + 1).Item(0)
                    d1 = prevD - d
                    x = d1.TotalSeconds
                    x = x1 + x
                    y = temp_sec.Tables(0).Rows(I).Item(1)
                    list.Add(x, y)
                    x1 = x
                End If
            End If

Enter key does not work for PasswordRecovery



On the following code for PasswordRecovery

 <asp:PasswordRecovery ID="PasswordRecovery1" Runat="server">
  <table border="0" cellpadding="1">
        <table border="0" cellpadding="0">
            <td align="center" colspan="2">
              Forgot Your Password?</td>
            <td align="center" colspan="2">
              Enter your User Name to receive your password.</td>
            <td align="right">
              <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td>
              <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
              <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="PasswordRecovery1">*</asp:RequiredFieldVal

execute update timedout expires , table with trigger due to recovery of database


I have table A in database A  , in table A i have trigger to insert record to database B table A, each update and insert of database A -table A, triiger fire and insert record in database B table A, when i try to update some times asp.net application gives error

"Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."

and then error log says System.Data.SqlClient.SqlException: Database 'database B is being recovered. Waiting until recovery is finished.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean ret

Trying to set update panel trigger programmatically


 I have a recursive sub that finds a dropdown list and sets up an AsyncPostbackTrigger for an update panel. I have tried calling this sub both from page_init and page_load 

If the dropdownlist is within the update panel, eveything works fine. If the dropdown list is not in the updatepanel I get error

A control with ID 'ddlPersonFilter' could not be found for the trigger in UpdatePanel 'up1'. In both cases the sub does find the dropdown list and executes the code to set up the trigger. Thanks for your help.

    Private Sub SetUpdatePanelTrigger(ByVal oControl As Control)
        For Each ctrl As Control In oControl.Controls
            If TypeOf ctrl Is DropDownList Then
                If CType(ctrl, DropDownList).ID = "ddlPersonFilter" Then
                    Dim thisddl As New DropDownList
                    Dim thistrigger As New AsyncPostBackTrigger
                    thisddl = ctrl
                    thistrigger.EventName = "SelectedIndexChanged"
                    thistrigger.ControlID = thisddl.ID
                    Exit Sub
                End If
                If ctrl.HasControls Then
                End If
            End If

Enter your credentials to connect to the web service


When trying to publish an InfoPath 2007 form template (as a Content Type), I am getting the following message with a UserName/Password dialog box:
Enter your credentials to connect to the following web service: http://MySitePath/_vti_bin/Webs.asmx

When I enter my credentials, the above dialog box appears again. I have carefully entered my credential. Another thing I noticed that despite this error I see the form got created at the destination library. The only thing is that the Content Type did not get created and hence is not available in the "Site Content Type Gallery".

We are using Sharepoint 2007 enterprise edition. And I have recently published the InfoPath form templates several time as Content type without any issue.


Please help. Thanks........

Loop for every record


Hi guys.

I've got a simple table with an ID, a NAME and an ARCHIVE booleen.

I want to write piece of code that goes through each record and...

If ARCHIVE is false and a folder hasn't been created for it, it will create it and go to the next record.

If ARCHIVE is false and a folder has been created for it, it will do nothing and go to the next record.

If ARCHIVE is true the whole folder will be moved to another folder and go to the next record.

When all records have been checked, the code will end.

I was thinking of using a SQL count to find out how many records there were and making a loop that starts at record one. runs the folder checking/creating/archiving code then +1 until the loop ends but I couldn't work out how to assign the query results to an integer...

I'm not asking for anyone to write the code. I think I probably already know 80% of the theory behind doing this I just can't glue it all together. I know you can do the folder stuff with the System.IO Directory Class...

Anyway, all input is welcome. Cheers guys!


jqGrid with WebMethods in aspx.cs files



here is my code for jqgrid:

/// <reference path="jquery-1.3.2.js" />
/// <reference path="json2.js" />
/// <reference path="jquery.simplemodal.js" />
$(document).ready(function() {

Combobox and Enter key


I have added a combobox to my page. Listview is updated based on selection from combobox. It is working great except it does not fire when Enter is pressed. User has to click on option from dropdown or has to press tab key to have Listview to populate. I want the user to be able type use arrow key to select option and then press the enter key for event to fire.

Using .net 3.5 and c#


Loop with DataReader


Hi.  I am having a really hard time with this code trying to loop through a datareader, and then enter the data into another table.  The logic is that I get 2 columns path and document_no from an Oracle Database.  I then need to check if the file in the path column is a valid path.  If it is not valid, it should be inserted into a SQL Server 2005 database.  My code is below, can anyone help?  I'm getting a headache from it.  If any further info is needed just let me know.  Thanks. 

Do While oraReader.Read()
                path1 = oraReader("Path")
                docno = oraReader("Document_No")
                If (System.IO.File.Exists(path1)) Then                    
                    sqlCmd = New SqlCommand("INSERT INTO CHECKLINKS1 (DOCUMENT_NO) VALUES (@doc)", conn)
                    sqlCmd.Parameters.AddWithValue("@doc", docno)
                End If


how to get current loop order number in "for each" ?

For Each item As pages.tbl1Row In pagesdim x as integerx = ?????response.write("current loop is :" & x )               Nextwhat code i need to replace with "?????" to get current loop order?

Generic Audit Trigger CLR C#(Works when the trigger is attached to any Table)

This Audit Trigger is Generic (i.e. non-"Table Specific") attach it to any tabel and it should work.  Be sure and create the 'Audit' table first though. The following code write audit entries to a Table called'Audit' with columns 'ActionType'    //varchar'TableName'    //varchar'PK'    //varchar'FieldName'    //varchar'OldValue'    //varchar'NewValue'    //varchar'ChangeDateTime'    //datetime'ChangeBy'    //varchar using System;using System.Data;using System.Data.SqlClient;using Microsoft.SqlServer.Server; public partial class Triggers{//A Generic Trigger for Insert, Update and Delete Actions on any Table[Microsoft.SqlServer.Server.SqlTrigger(Name = "AuditTrigger", Event = "FOR INSERT, UPDATE, DELETE")] public static void AuditTrigger(){SqlTriggerContext tcontext = SqlContext.TriggerContext; //Trigger Contextstring TName; //Where we store the Altered Table's Namestring User; //Where we will store the Database UsernameDataRow iRow; //DataRow to hold the inserted valuesDataRow dRow; //DataRow to how the deleted/overwritten valuesDataRow aRow; //Audit DataRow to build our Audit entry withstring PKString; //Will temporarily store the Primary Key Column Names and Values hereusing (SqlConnection conn = new SqlConnection("context connection=true"))//Our Connection{conn.Open();//Open the Connection//Build the AuditAdapter an
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend