The idea is that when I click the print button inside a gridview it calls that page that I posted just above and display the data via the label bringing from the database, but so far I'm hooked on the modal part.
Class of the click event of my button that calls the top page.
It seems you expect that when clicking LinkButton imgPrint, the page you gave above will show as model pop up and when you click the button in the page it will post to action.php.
// bind click event to the button btnImprimir and when your click it , the form will post to page_action.php // because I change the action attribute of the form to page_action.php
$("#btnImprimir").click(
function () {
$("#form1").attr("action", "/page_action.php");
$("#form1").submit();
}
)
})
</script>
</form>
Code behind.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ArrayList list = new ArrayList();
list.Add(new { Flag = "myflag" });
GridView1.DataSource =list;
GridView1.DataBind();
}
}
protected void imgPrint_Command(object sender, CommandEventArgs e)
{
if (e.CommandName == "Print")
{
//get argument
string arg = e.CommandArgument.ToString();
//simulate data from database
input1.Text = "input1's datafromDatabase";
input2.Text = "input2's datafromDatabase";
input3.Text = "input3's datafromDatabase";
//show the model pop up
ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "$('#myEditModal').modal('show')", true);
}
}
}
And in my page_action.php (I use an aspx instead) , I try to receive the posted page to see whether it could receive the data.I write
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Ackerly Xu, could you kindly remove the part of the image on your test? Because it should not appear, in his image ended up showing why I unintentionally posted the coat of arms of the image rsrs.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
I accidentally put it in, but I also removed from mine, because it is a state that has its principles and we have no problems, I removed mine too. Could you help me out on this other Ackerly Xu topic?
Member
48 Points
143 Posts
How to implement the modal?
Oct 18, 2018 03:09 AM|rtaVix|LINK
How to apply the modal function in my code structure to display the centralized page?
The idea is that when I click the print button inside a gridview it calls that page that I posted just above and display the data via the label bringing from the database, but so far I'm hooked on the modal part.
Class of the click event of my button that calls the top page.
my method BUTTON html:
Contributor
3500 Points
1300 Posts
Re: How to implement the modal?
Oct 19, 2018 02:49 AM|Ackerly Xu|LINK
Hi rtaVix,
It seems you expect that when clicking LinkButton imgPrint, the page you gave above will show as model pop up and when you click the button in the page it will post to action.php.
If so , you could try the code below.
Code behind.
And in my page_action.php (I use an aspx instead) , I try to receive the posted page to see whether it could receive the data.I write
About ScriptManager.RegisterStartupScript , it is used to register script in aspx. Please refer to https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.scriptmanager.registerstartupscript?view=netframework-4.7.2
About bootstrap's modal ,please refer to https://getbootstrap.com/docs/4.1/components/modal/
Best regards,
Ackerly Xu
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
48 Points
143 Posts
Re: How to implement the modal?
Oct 25, 2018 06:43 PM|rtaVix|LINK
Ackerly Xu, could you kindly remove the part of the image on your test? Because it should not appear, in his image ended up showing why I unintentionally posted the coat of arms of the image rsrs.
Contributor
3500 Points
1300 Posts
Re: How to implement the modal?
Oct 30, 2018 02:56 AM|Ackerly Xu|LINK
Hi rtaVix,
I'm sorry , I have removed the image.
Best regards,
Ackerly Xu
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
48 Points
143 Posts
Re: How to implement the modal?
Oct 30, 2018 01:14 PM|rtaVix|LINK
I accidentally put it in, but I also removed from mine, because it is a state that has its principles and we have no problems, I removed mine too. Could you help me out on this other Ackerly Xu topic?
https://forums.asp.net/t/2148427.aspx?+Doubt+when+loading+database+information
Thank you very much for your help, which was very important.
Regards, RtaVix