Click here to Skip to main content
15,890,670 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: ASP .Net Pin
ZurdoDev3-Jul-12 4:02
professionalZurdoDev3-Jul-12 4:02 
GeneralRe: ASP .Net Pin
CodingLover3-Jul-12 4:07
CodingLover3-Jul-12 4:07 
GeneralRe: ASP .Net Pin
Member 34876323-Jul-12 20:10
Member 34876323-Jul-12 20:10 
AnswerRe: ASP .Net Pin
ZurdoDev5-Jul-12 2:37
professionalZurdoDev5-Jul-12 2:37 
QuestionC# web form Pin
dcof2-Jul-12 6:14
dcof2-Jul-12 6:14 
AnswerRe: C# web form Pin
R. Giskard Reventlov2-Jul-12 7:16
R. Giskard Reventlov2-Jul-12 7:16 
AnswerRe: C# web form Pin
Abhinav S2-Jul-12 19:48
Abhinav S2-Jul-12 19:48 
QuestionHow to execute button event inside new model page using window.showModalDialog? Pin
sanjaykumarjaiswal21-Jul-12 17:33
sanjaykumarjaiswal21-Jul-12 17:33 
How to execute button event inside new model page using window.showModalDialog?
When i open new model dialog and clicked on button, new popup window generated.


function OpenModalDialog(url, btnName, diaHeight) {
// alert("new window");
// debugger ;
var vReturnValue;
if (diaHeight == null || diaHeight == "")
diaHeight = "300";
if (url != null) {
// vReturnValue = window.showModalDialog(url, "#1", "dialogHeight: " + diaHeight + "px; dialogWidth: 600px; dialogTop: 190px; dialogLeft: 220px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");
// vReturnValue = window.showModalDialog("Default3.aspx", "#1", "dialogHeight: " + diaHeight + "px; dialogWidth: 600px; dialogTop: 190px; dialogLeft: 220px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");
window.open(url, "mywindow", "dialogHeight: " + diaHeight + "px; dialogWidth: 600px; dialogTop: 190px; dialogLeft: 220px; edge: Raised; center: Yes; help: No; resizable: No; status: No);");
}
else {
alert("No URL passed to open");
}
if (vReturnValue != null && vReturnValue == true) {
// __doPostBack(btnName, '');
//alert(vReturnValue);
// document.getElementById('LinkButton1').style.display = 'visible';
return vReturnValue
}
else { //alert(vReturnValue);
//alert(vReturnValue);
// return false;
return false;
}
}
function ExporttoExcel() {
// alert("Sucessfully Completed");
// document.getElementById('div').style.display = 'visible';
// document.getElementById('<%= LinkButton1.ClientId%>').value = "ExporttoExcel";
}


Welcome to ASP.NET!



To learn more about ASP.NET visit www.asp.net.



You can also find documentation on ASP.NET at MSDN.


<asp:button id="Button1" runat="server" text="Generate">

<asp:linkbutton id="LinkButton1" runat="server">




Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objpublist As New List(Of Publishers)
objpublist.Add(New Publishers With {.pub_name = "xxx", .city = "Dhanbad", .pub_id = 0})
objpublist.Add(New Publishers With {.pub_name = "yyy", .city = "Varanasi", .pub_id = 1})
objpublist.Add(New Publishers With {.pub_name = "zzz", .city = "Rudrapur", .pub_id = 1})
objpublist.Add(New Publishers With {.pub_name = "aaa", .city = "Delhi", .pub_id = 0})
objpublist.Add(New Publishers With {.pub_name = "bbb", .city = "Nodia", .pub_id = 1})
Session("PublishersList") = objpublist
Dim ScriptOpenModalDialog As String = "javascript:OpenModalDialog('{0}','{1}','{2}');"
Dim strURL = "Default3.aspx"
Page.ClientScript.RegisterStartupScript(Me.GetType(), "window-script", String.Format(ScriptOpenModalDialog, strURL, "", "300"), True)
End Sub


====================Popup page code==============

function CloseWindow() {
window.opener.ExporttoExcel()
window.top.close();
}
function ShowSelection() {

var textComponent = document.getElementById('TextBox2');
var selectedText; // IE version
if (document.selection != undefined)
{ textComponent.focus();
var sel = document.selection.createRange();
selectedText = sel.text;
}
// Mozilla version
else if (textComponent.selectionStart != undefined)
{
var startPos = textComponent.selectionStart;
var endPos = textComponent.selectionEnd;
selectedText = textComponent.value.substring(startPos, endPos)
}
// alert("You selected: " + selectedText);
document.getElementById('TextBox3').value = selectedText;
}
function Validate() {
// ShowSelection();
// debugger;
if (document.getElementById('TextBox3').value == "")
{
// var err = document.getElementById('MandateNameErr');
// err.innerHTML = "Please enter a value for the Mandate Name";
// err.style.display = "block";
alert("Please enter a value for the Mandate Name")
return false;
}
// else {
// document.getElementById('MandateNameErr').style.display = "none";
// }
// if (document.getElementById('MandateDescription').value == "")
// {
// var err = document.getElementById('MandateDescriptionErr');
// err.innerHTML = "Please enter a value for the Mandate Description";
// err.style.display = "block";
// return false;
// }
// else {
// document.getElementById('MandateDescriptionErr').style.display = "none";
// }
// return true;
}





<asp:label id="Label1" runat="server" text="Name">
<asp:textbox id="TextBox1" runat="server">
<asp:label id="Label2" runat="server" text="city">
<asp:textbox id="TextBox2" runat="server" textmode="MultiLine" onmousemove="ShowSelection();">
<asp:label id="Label3" runat="server" text="CityCode">
<asp:textbox id="TextBox3" runat="server">
<asp:button id="Button2" runat="server" text="Submit" onclientclick="return Validate()">
<asp:linkbutton id="LinkButton1" runat="server">LinkButton
<asp:label id="MandateNameErr" runat="server" text="Label">





Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim bflag As Boolean = False
objpublist = Session("PublishersList")
If objpublist IsNot Nothing Then
For i = 0 To objpublist.Count - 1
If objpublist(i).pub_id = 0 Then
TextBox1.Text = objpublist(i).pub_name
TextBox2.Text = objpublist(i).city
TextBox3.Text = ""
bflag = True
Exit For
End If
Next
End If
If bflag = False Then
Page.ClientScript.RegisterStartupScript(Me.GetType(), "CloseWindow", "CloseWindow();", True)
End If
End If
End Sub
'''
'''
'''

''' <param name="sender" />
''' <param name="e" />
''' <remarks>
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim bflag As Boolean = False
objpublist = Session("PublishersList")
If objpublist IsNot Nothing Then
For i = 0 To objpublist.Count - 1
If objpublist(i).city = TextBox2.Text Then
objpublist(i).pub_id = i + 1
For j = i + 1 To objpublist.Count - 1
If j <= objpublist.Count - 1 AndAlso objpublist(j).pub_id = 0 Then
TextBox1.Text = objpublist(j).pub_name
TextBox2.Text = objpublist(j).city
TextBox3.Text = ""
bflag = True
Exit For
End If

Next
' If bflag = True Then
Exit For
'End If
End If
Next
Session("PublishersList") = objpublist
End If
If bflag = False Then
Page.ClientScript.RegisterStartupScript(Me.GetType(), "CloseWindow", "CloseWindow();", True)
End If
End Sub
AnswerRe: How to execute button event inside new model page using window.showModalDialog? Pin
jkirkerx2-Jul-12 10:59
professionaljkirkerx2-Jul-12 10:59 
GeneralC# web assembly Pin
classy_dog1-Jul-12 11:27
classy_dog1-Jul-12 11:27 
GeneralRe: C# web assembly Pin
Sandeep Mewara1-Jul-12 20:38
mveSandeep Mewara1-Jul-12 20:38 
QuestionC# app using iis Pin
classy_dog1-Jul-12 11:25
classy_dog1-Jul-12 11:25 
AnswerRe: C# app using iis Pin
Sandeep Mewara1-Jul-12 20:36
mveSandeep Mewara1-Jul-12 20:36 
GeneralHow to Create simple forum web site??? Pin
ICEFLOWER21-Jul-12 5:46
ICEFLOWER21-Jul-12 5:46 
AnswerRe: How to Create simple frume web site??? Pin
Parwej Ahamad1-Jul-12 6:26
professionalParwej Ahamad1-Jul-12 6:26 
GeneralRe: How to Create simple forum web site??? Pin
Sandeep Mewara1-Jul-12 20:46
mveSandeep Mewara1-Jul-12 20:46 
GeneralTry Codeplex Pin
David Mujica2-Jul-12 5:17
David Mujica2-Jul-12 5:17 
QuestionParameter 'xxxxx' not found in the collection Pin
Jassim Rahma1-Jul-12 4:09
Jassim Rahma1-Jul-12 4:09 
AnswerRe: Parameter 'xxxxx' not found in the collection Pin
Parwej Ahamad1-Jul-12 6:25
professionalParwej Ahamad1-Jul-12 6:25 
AnswerRe: Parameter 'xxxxx' not found in the collection Pin
jkirkerx2-Jul-12 10:44
professionaljkirkerx2-Jul-12 10:44 
GeneralRe: Parameter 'xxxxx' not found in the collection Pin
Jassim Rahma7-Jul-12 5:54
Jassim Rahma7-Jul-12 5:54 
GeneralRe: Parameter 'xxxxx' not found in the collection Pin
Jassim Rahma7-Jul-12 5:59
Jassim Rahma7-Jul-12 5:59 
GeneralRe: Parameter 'xxxxx' not found in the collection Pin
jkirkerx7-Jul-12 12:30
professionaljkirkerx7-Jul-12 12:30 
GeneralRe: Parameter 'xxxxx' not found in the collection Pin
Jassim Rahma8-Jul-12 4:19
Jassim Rahma8-Jul-12 4:19 
GeneralRe: Parameter 'xxxxx' not found in the collection Pin
Jassim Rahma8-Jul-12 4:25
Jassim Rahma8-Jul-12 4:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.