Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
C#
function GetSelectedRow(e) {
       var clickedRow = $(e).closest("tr");
       var id = $(clickedRow).find('td').eq(0).text();
       var gvcheck = document.getElementById('<%=dgv_Modules.ClientID %>');
       var chklist = gvcheck.getElementsByTagName('input');
       for (var i = 0; i < chklist.length; i++) {
           if ($(chklist[i]).prop("checked")) {

               var checkedrow = $(chklist[i]).closest("tr");
               var moduleid = $(checkedrow).find('td').eq(0).text();
           }
       }
       return false;
   }



This is jquery code from which I got ModuleID. and now i want to display all the records related to module id from the database.
Posted
Comments
Sergey Alexandrovich Kryukov 20-Aug-14 4:26am    
Why do you think it should be done on client side? You are using ASP.NET, so do it on the server side. Client side would be unsafe, to tell the least.
—SA
m-shraddha 20-Aug-14 6:32am    
I am using jQuery because it was demanded by project leader
Sergey Alexandrovich Kryukov 20-Aug-14 11:06am    
(Sigh...) But then, why discussing anything here? Ask you project leader. Or let your project leader asking me questions. Why wasting time with someone who does not make the decisions?
Sorry...
—SA
m-shraddha 20-Aug-14 12:32pm    
By the way..I didnt ask you anything and had not told you to comment here. So do not post comment unnecessarily. People who really want to suggest solution will post it here. This is not a place to write meaningless sentences that we want.
Sergey Alexandrovich Kryukov 20-Aug-14 12:55pm    
How can you be so rude and shameless?

Do you think that you are more free than others? If you are free to write the comment I don't like, why any other cannot write a comment you would not like? And you did not even understand that I comment to help you and others.

And don't lie to people here. Everyone can read and see what happened. I suggested you the solution. Did you noticed that? If you don't like the solution, ask some question. Or, better, ask your leader. Why would you afraid asking this person? Do you understand that this reference to your leader is incorrect? Why should we talk to the one who is not making the decisions? All questions should be motivated. If you don't know why doing something which someone told you, you should not do it. Use my advice and discuss this problem with your leader.

—SA

Hi,


Visit link this will help you.
 
Share this answer
 
v2
As you got the Module ID, then execute one jQuery Ajax Request and call a WebMethod. Inside the WebMethod, fetch records from Database and Bind to the Grid.

Refer - Bind Dataset to ASP.Net GridView using jQuery AJAX[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900