is there a way where I can show an aspx form without using javascript?
Is there like this code in a asp button?
protected void btnLookUpPayment_Click(object sender, ImageClickEventArgs e)
{
webLookUpPayment wblp = new webLookUpPayment();
wblp.ShowModalDialog();
}
Because using a javascript popup modal is actually not my option, I have a gridview in my modal and upon clicking a row in that gridview, i will populate another gridview in another form, I can't explain it thoroughly because it is confusing, just want to know if there is a way where I can show a modal without using any javascript?
Thanks in advance for your help guys!
It will perfectly work. For pop up new .aspx from code behind
Response.Write("<script>window.open('About.aspx', 'hello', 'width=700,height=400,scrollbars=yes');</script>");
And for new window without pop up
ClientScript.RegisterStartupScript(this.GetType(), "OpenWindow", String.Format("<script>window.open('{0}');</script>", "About.aspx"));
mark it as answer if it works. Thanks
Related
I'm new to asp.net and C#. Right now, I'm creating a small webpage with panels etc.
Situation:
I got a Panel (let's say Panel1). And an Imagebutton (Button1).
I can Show the Panel (onclick event) in aspx with visible = true.
Problem:
How do I close the Panel using the same button? I dont want to use Javascipt or jquery or anything else that is Client site.
Is there a simple solution for that?
Forgive my ignorance if this isn't available in ASP.NET but could you not do something like
Button1_ServerClick(object sender, EventArgs e)
{
Panel1.Visible = !Panel1.Visible; //toggles visibility
}
I have one asp.net page with two gridview using updatepanel.when i click the submit button data inserting in db and update the gridview. i'm handling duplicate insertion of same data when refresh the page. but the problem is when i refreshing the page previous data in the gridview showing not present data. again if i'm clicking the menu its reloading and showing actual data.i'm handling button click but i don't know how to handle this gridview problem when i refresh the page. if anybody pass through same problem please show some light on this or please give some suggession.
I would try:
gridviewObj.datasource = null
gridviewobj.datasource.databind();
... hope this helps
you could do this
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
//here you bind again the datagrid
}
}
Use if(IsPosback) in Page_Load event
then
UpdatePanel.Update();
I have one user control having gridview in it.In my aspx page i have modal popup to show this user control.So,when i click on page index modal popup get disappears.
So,how can i avoid disappearance of modal popup on page index change in asp.net.
Thanks.
C# code:
public bool showModelPopup = false;
void GridView1_PageIndexChanging(Object sender, GridViewPageEventArgs e)
{
showModelPopup = true;
//Your code
}
.apsx: (jQuery)
$(function(){
if ("<%=showModelPopup%>" == "true")
$("#ModelPopUpID").show();
});
Every postback will cause the Popup to disappear. If just certain postsback can handle during your popup you could put a MyModalPopupExtender.Show() into the code that handles that postbacks.
I am using TelerikRadGrid in ASP.NET. When I press edit or add new, a new PopUp window appears, when I fill the data and save everything is OK, but the popup window stays.
So how can I save and close the window at the same time (I know how to save, but I don't know how to close the window after saving?)
Did you search the Telerik's forum? Popup Edit form not closing
When your page reloads after saving the data you need to put a JavaScript window.close()
Or programatically you can try:
protected void RadGrid1_ItemInserted(object sender, GridInsertedEventArgs e)
{
e.KeepInInsertMode = false;
}
I've got a gridview/formview, master/detail relationship going on.
When I click a button in my formview (item template), I display an ajaxcontroltoolkit modal popup.
On this popup there is a textbox (several, actually). I want to validate the data in this textbox (at least six digits, so far I'm using a regex validator) before I dismiss the popup.
The validator works, but I can still dismiss the form by clicking OK. What I'd like to do is have the ok button on the popup disabled until the data is good.
I have tried fiddling with some stuff in javascript, but I couldn't make it work, as there seems to be some issues regarding finding controls in a formview.
Any ideas?
Thanks in advance.
Without a postback
You should be able to find a control using the following technique in JavaScript:
$document.getElementById('<%=btnSubmitForm.ClientID%>').disabled = true;
If you're using RegularExpressionValidator, this forum suggests a quick (albeit hacky) way to check and see if your form is valid, without doing a postback:
http://forums.asp.net/t/1114240.aspx
With a postback
You could put the Submit button in its own UpdatePanel, if it isn't already in one, and enable/disable it in the code behind, depending on the value of the validator's IsValid property.
If you're unable to get the enable/disable functionality working, you could simply keep the modal open, so the user can't close it until they enter valid inputs or click Cancel:
protected void BtnSubmitClick(object sender, EventArgs e)
{
if (!regexValidator.IsValid)
{
modalPopupExtender.Show();
}
}