|
It should work. @OP, did you debug your code?
If you've never failed... You've never lived...
|
|
|
|
|
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Requested URL: /testing/demo.asp
*******************
Above is the error i 'm getting on my development machine using VS2008
******On IIS 7 also i'm getting error
|
|
|
|
|
The error is telling you that asp files are blocked. It has nothing to do with your code but is an IIS setting. I am not sure where so you may want to google the error.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I want to decompile a C# 2010 web form application. I am not certain what files I would use to decompile and where those files are located at. When I create a deployment project using the setup and deployment method that visual studio will not be using starting in visual studio 2012, I am looking in the bin directory. I would think there would be an exe that i could decompile.
However there several dll files.
Thus to decompile a C# 2010 web form application would i find an exe and/or would I need to use all the dll files? If I use all the DLL files, how would I combine them together so I can decompile?
|
|
|
|
|
JetBrains dotPeek 1.0[^] is what I've been using. Seems as good as any of the others.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
You can always consider using Reflector[^]. It is not free, of course.
|
|
|
|
|
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
|
|
|
|
|
I think you should go back and edit your post using the pre tags to wrap your code in, that too hard to read, and will result in a poor answer.
sanjaykumarjaiswal2 wrote: How to execute button event inside new model page using window.showModalDialog?
If your using the modelPopupExtender, you should start out by using the server side to create it, design the look and feel of it, and define the buttons such as submit and close.
You can use javascript to control the extender, but the extender already writes the javascript for you automatically.
You didn't post the actual popup html, for inspection, that's all that was needed to help you.
My best guess is that your button is not wired up to the modalpopuextender, or does not have a handler assigned to the button click, to wire them up together.
|
|
|
|
|
I want to be able to create a web application that comes from the following link:
http://www.asp.net/community/control-gallery/Item.aspx?i=69
However I am not certain where a root directory of a web application would be for this test application. How woud I set this up in visual studio 2010? Would I create an empty web application? If so, what would be considered the root directory to place the files for this application from?
I am referring to directions in the app that are listed here:
Unzip all the files into the root directory of a web application with a bin directory.
Run mk.bat to build MasterPages.dll into your bin directory.
Use your browser to request the test page http://localhost/yourtestapp/TestPage.aspx
modified 1-Jul-12 21:05pm.
|
|
|
|
|
|
This is the first time I am working with a C# 2010 web form application that runs on iis 7. I would like to know what the directory path difference is for local iis versus iis pointing to the root directory:
Is the reference for:
a. local iis look like http://localhost:4040 where 4040 is the port number? or is the path http://localhost/sup where sup is a directory path?
If I am wrong, can you tell me what the directory path is for local IIS? Also can you explain why that is directory path to use?
b. Can you tell me how to refer to the root directory for the web form application in IIS 7.?
|
|
|
|
|
classy_dog wrote: local iis look like http://localhost:4040 where 4040 is the port number?
This is not local IIS. This is Visual studio's inbuild web server.
classy_dog wrote: I would like to know what the directory path difference is for local iis versus iis pointing to the root directory:
What you refer to as local IIS here is Visual Studio internal web server.
Details on various web servers in VS: MSDN: Web Servers in Visual Studio for ASP.NET Web Projects[^]
classy_dog wrote: how to refer to the root directory for the web form application in IIS 7
On how you can define a web server for your project, here: MSDN: How to: Specify the Web Server for Web Projects in Visual Studio[^]
|
|
|
|
|
|
Search on code project OR google you will found many articles, sample OR open source.
Parwej Ahamad
|
|
|
|
|
ICEFLOWER2 wrote: How Can I to Make simple forum website With Login/LogOut Users and Send/Ask Question or Answer
You need to create an ASP.NET web application. Define:
1. Login page. Implement login-logout feature
2. Submit question page. Implement simple ask a question form where you have from, to, subject, body kind of layout for question submission.
For login, this should help:
How to: Create an ASP.NET Login Page[^]
Try!
|
|
|
|
|
|
Hi,
I am getting the following error:
Parameter 'param_login_ip_address' not found in the collection.
but parameter was already submitted here:
sql_command.Parameters.Add("param_login_ip_address", MySqlDbType.VarChar).Value = (string)Request.ServerVariables["REMOTE_ADDR"];
and it's already specified in the MySQL parameters as well:
IN `param_id_number` varchar(255),IN `param_login_password` varchar(255),IN `param_login_pin` varchar(255),IN `param_login_ip_address` varchar(255),IN `param_machine_name` varchar(255),IN `param_os_version` varchar(255)
then where is the problem please?
|
|
|
|
|
|
jrahma wrote: (string)Request.ServerVariables["REMOTE_ADDR"];
As the previous post said, you have to make sure the value really exist before you assign it to something.
1. So you should of gathered up all your data first,
2. check to make sure it is complete and formatted correctly,
3. then do your write to the database.
|
|
|
|
|
I am sure REMOTE_ADDR is returning the correct value. because I tried to write it and getting the data. also I am getting everything working on local laptop and this problem occurs only on host.
I even tried to pass DBNull.Value but getting the same error!
if (Request.ServerVariables["REMOTE_ADDR"] != null) sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = DBNull.Value;
else sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = DBNull.Value;
|
|
|
|
|
|
That's a nice looking website, good job. I like the buttons, whole site is nice and clean.
param_ipAddress, the param is missing from 1 of 3 places, below
UPDATE Contact Set(ipAddress=@ipAddress) <- Is this missing
Or is your Param not stated correctly ?
Dim paramIPAddress As SqlParameter
paramIPAddress = New SqlParameter("@ipAddress", SqlDbType.VarChar, 80)
paramIPAddress.Value = ipAddress
myCommand.Parameters.Add(paramIPAddress)
Or is the value simply missing?
ipAddress simply has no value and = nothing
|
|
|
|
|
is it really nice? Thanks.. I am still working on completing it
Regarding where I am using it in the stored procedure.. it's here:
IN `param_id_number` varchar(255),IN `param_login_password` varchar(255),IN `param_login_pin` varchar(255),IN `param_ip_address` varchar(255),IN `param_machine_name` varchar(255),IN `param_os_version` varchar(255)
and then here:
INSERT INTO event_log (event_log_category, event_log_user, event_log_ip_address, event_log_machine_name, event_log_os_version, event_log_text) VALUES ('Audit', param_id_number, param_ip_address, param_machine_name, param_os_version, 'User logged on successfully');
and this is my parameter:
if (Request.ServerVariables["REMOTE_ADDR"] != null) sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = Request.ServerVariables["REMOTE_ADDR"];
else sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = DBNull.Value;
value is not missing because I am able to write and I am also checking it if not null as you can see in above code...
|
|
|
|
|
Thanks everyone.
My problem if solved.
I used:
if (Request.ServerVariables["REMOTE_ADDR"] != null) sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = HttpContext.Current.Request.UserHostAddress;
else sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = DBNull.Value;
|
|
|
|
|
sorry... problem is still there..
I didn't notice I was working on local...
and that's another question.. why it's working on local but throwing the error on host?!
|
|
|
|
|