Jan 08, 2021 08:15 PM|anjaliagarwal5@yahoo.com|LINK
Hello All,
I have a gridview in a web user control. In my Gridview, I have a delete button, a text box. I can increase the number in the textbox and I can also delete the items in the Gridview. Depending on the number in the textbox, I can also calculate the total
at the bottom of the gridview. Gridview works fine on the .aspx page, but when I put the Gridview on the .ascx page and put the .ascx page on my web form (aspx) page. Delete button, total and the text box is not responding at all. Below is my code for the
GridView:
Jan 08, 2021 10:09 PM|anjaliagarwal5@yahoo.com|LINK
SurferOnWww
Did you confirm that the postback occurs as expected when you operate the button?
If I put the Gridview on .aspx page then postback occurs, but when I put the gridview on .ascx page and then click the gridview delete button on aspx page then postback does not occur.
Can you minimize the current code by removing the portion not required to reproduce the issue (i.e, no postback occurs) so that you will be able to identify the cause?
Jan 10, 2021 04:43 AM|anjaliagarwal5@yahoo.com|LINK
I minimized the code. It seems everything is working except when I click on delete button , modal pop does not show in the side panel and that causes not the post back issue. I am not sure how to show the modal pop when user clicks the delete button. I
can show the modal pop up in the panel or outside the side panel or may be the modal pop up is showing but it is coming to the right side of the panel and I cannot see it.This is a very simple example that I created:
Are you using both the jquery mobile overlay panel and the ModalpopupExtender? It is completely out of my understanding.
What you mentioned in your previous thread as your requirement was that “click the shopping cart button at the top of the page” slides and shows the shopping cart in the user control. I understand the it could be done through the Q&A in the pervious thread.
Now you are adding the ModalpopupExtender. How do you expect the jquery mobile overlay panel and the ModalpopupExtender interact? Isn’t there any conflict between then?
Jan 10, 2021 05:46 AM|anjaliagarwal5@yahoo.com|LINK
Yes, I am using both the mobile overlay panel and the ModalpopupExtender. I think there is a conflict between them because I don't see modal pop up extender. The only reason, I am using the ModalPOP upExtender is when the user clicks on the Gridview
delete button, I want to ask for confirmation through modalPOPUPExtender. I
don't know any other way. Can you please suggest if I can use something else. All I want to do is show the gridview in a panel that
extends from the right side of the screen and gridview is a web user control. I want to show the conformation box when user tries to delete the row from the gridview.
> The only reason, I am using the ModalPOP upExtender is when the user clicks on the Gridview delete button, I want to ask for confirmation through modalPOPUPExtender.
It is not good idea to use the ModalPopup for such purpose,
So, forget about the ModalPopup and consider to use javascript confirm method instead.
I guess you use the ImageButton as the delete button. If so, set the script to the OnClientClick property such like:
OnClientClick='janascript: return confirm("are you sure to delete?");'
Member
505 Points
1259 Posts
gridview as a web user control
Jan 08, 2021 08:15 PM|anjaliagarwal5@yahoo.com|LINK
Hello All,
I have a gridview in a web user control. In my Gridview, I have a delete button, a text box. I can increase the number in the textbox and I can also delete the items in the Gridview. Depending on the number in the textbox, I can also calculate the total at the bottom of the gridview. Gridview works fine on the .aspx page, but when I put the Gridview on the .ascx page and put the .ascx page on my web form (aspx) page. Delete button, total and the text box is not responding at all. Below is my code for the GridView:
Below is the code behind for deleting, calculating total
Below is the gridview Rowdatabond code:
Grid view row deleting code:
Below is the Gridvie binding code:
I can see the Gridview populated in the aspx page, but none of the button are responding.
Member
150 Points
103 Posts
Re: gridview as a web user control
Jan 08, 2021 10:01 PM|SurferOnWww|LINK
Did you confirm that the postback occurs as expected when you operate the button?
Member
505 Points
1259 Posts
Re: gridview as a web user control
Jan 08, 2021 10:09 PM|anjaliagarwal5@yahoo.com|LINK
If I put the Gridview on .aspx page then postback occurs, but when I put the gridview on .ascx page and then click the gridview delete button on aspx page then postback does not occur.
then postback does not occur.
Member
150 Points
103 Posts
Re: gridview as a web user control
Jan 08, 2021 10:58 PM|SurferOnWww|LINK
Can you try it without the UpdataPanel?
Member
505 Points
1259 Posts
Re: gridview as a web user control
Jan 08, 2021 11:30 PM|anjaliagarwal5@yahoo.com|LINK
I commented out the updatePanel. still the postback is not occurring when I tried to delete the GridView row.
Member
150 Points
103 Posts
Re: gridview as a web user control
Jan 08, 2021 11:38 PM|SurferOnWww|LINK
Can you minimize the current code by removing the portion not required to reproduce the issue (i.e, no postback occurs) so that you will be able to identify the cause?
Member
505 Points
1259 Posts
Re: gridview as a web user control
Jan 10, 2021 04:43 AM|anjaliagarwal5@yahoo.com|LINK
I minimized the code. It seems everything is working except when I click on delete button , modal pop does not show in the side panel and that causes not the post back issue. I am not sure how to show the modal pop when user clicks the delete button. I can show the modal pop up in the panel or outside the side panel or may be the modal pop up is showing but it is coming to the right side of the panel and I cannot see it.This is a very simple example that I created:
Below is the .ascx page code:
below is the code behind of .ascx page:
I didn't put any code inside OnRowDeleting because I just want to see the postback and the postback is not occurring because of modalpopup.
below is my .aspx page:
There is no code behind the .aspx page.
Member
150 Points
103 Posts
Re: gridview as a web user control
Jan 10, 2021 05:19 AM|SurferOnWww|LINK
Are you using both the jquery mobile overlay panel and the ModalpopupExtender? It is completely out of my understanding.
What you mentioned in your previous thread as your requirement was that “click the shopping cart button at the top of the page” slides and shows the shopping cart in the user control. I understand the it could be done through the Q&A in the pervious thread.
Now you are adding the ModalpopupExtender. How do you expect the jquery mobile overlay panel and the ModalpopupExtender interact? Isn’t there any conflict between then?
Member
505 Points
1259 Posts
Re: gridview as a web user control
Jan 10, 2021 05:46 AM|anjaliagarwal5@yahoo.com|LINK
Yes, I am using both the mobile overlay panel and the ModalpopupExtender. I think there is a conflict between them because I don't see modal pop up extender. The only reason, I am using the ModalPOP upExtender is when the user clicks on the Gridview delete button, I want to ask for confirmation through modalPOPUPExtender. I don't know any other way. Can you please suggest if I can use something else. All I want to do is show the gridview in a panel that extends from the right side of the screen and gridview is a web user control. I want to show the conformation box when user tries to delete the row from the gridview.
Highly appreciate your help.
Member
150 Points
103 Posts
Re: gridview as a web user control
Jan 10, 2021 06:08 AM|SurferOnWww|LINK
> The only reason, I am using the ModalPOP upExtender is when the user clicks on the Gridview delete button, I want to ask for confirmation through modalPOPUPExtender.
It is not good idea to use the ModalPopup for such purpose,
So, forget about the ModalPopup and consider to use javascript confirm method instead.
I guess you use the ImageButton as the delete button. If so, set the script to the OnClientClick property such like:
Member
505 Points
1259 Posts
Re: gridview as a web user control
Jan 10, 2021 09:50 PM|anjaliagarwal5@yahoo.com|LINK
Yes, everything work. I can delete the gridview row. Although, the pop up box look ugly, but it works. Thanks.