|
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?!
|
|
|
|
|
You don't need to check the value here, since your passing the value to a function, just make sure the value is good before passing it the fucntion, so remove the first line and do it earlier, when your gather data
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;
I;m not sure what the problem is. I see lot's of tiny errors like the @ in front of the parameter name. @param_id_number
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');
Those examples I gave you, you really need to look at the details of them.
On the param, you have to declare the variable, then make a new one. If you made the table column a width of let's say 80, use the 80.
I did some digging, and I stopped using the Server Request because it was not reliable, and changed to the UserHostAddress, use the context whenever you use request or response as a good habit.
Dim ipAddress as String = Nothing
ipAddress = HttpContext.Current.Request.UserHostAddress
Dim param_id_number As SqlParameter
param_id_number = New SqlParamter("@ip_Address, SQLDbType.VarChar, 80)
param_id_number.Value = <- Assign a pointer here like ipAddress
sql_command.Parameters.Add(param_ip_address)
|
|
|
|
|
I always copy the pointer to a buffer like ipAddress before using it.
if (Request.ServerVariables["REMOTE_ADDR"] != null){
ipAddress String = Request.ServerVariables["REMOTE_ADDR"];
sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = ipAddress;
}
else
{
sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = DBNull.Value;
}
|
|
|
|
|
Hi,
am having an excel file where it consists data as below
ID NAME DE
1 SURESH SE
2 SANJAY SE
3 NAGA TL
ID,NAME,DE are columns...
if the data in excel file is in the above format then i can easily transfer the data into database
but my problem is sometimes the data in excel sheet will be in the below format
ID NAME DE ID NAME DE
1 SURESH SE 4 RANK TL
2 SANJAY SE 5 RAMU PL
3 NAGA TL 6 RANI PM
here the Columns ID,NAME,DE are repeated so i want to make it in the below format and want to insert into database
ID NAME DE
1 SURESH SE
2 SANJAY SE
3 NAGA TL
4 RANK TL
5 RAMU PL
6 RANI PM
please help me out...
|
|
|
|
|
I am having problem with one line compiling in a production C# 2010 web form application. The line of code that is having the problem is either of the two following lines:
<%@ language="c#" debug="true" trace="false" %>
<%@ Register TagPrefix="mp" namespace="Microsoft.Web.Samples.MasterPages" assembly="MasterPages" %>
the error message is: 'Error 1 Could not load file or assembly 'MasterPages' or one of its dependencies. The system cannot find the file specified.
I am hoping you can tell me what is wrong. Could a url to iis7 local server be incorrect?
I orginally had the folloing 3 extra lines of code of code that contained error messages:
Error 2 Unknown server tag 'mp:contentcontainer'. C:\Users\Sup\TestPage.aspx 14
Error 3 Unknown server tag 'mp:content'. C:\Users\Sup\TestPage.aspx 16
Error 4 Unknown server tag 'mp:content'. C:\Users\Sup\TestPage.aspx 22
I fixed the above error message by adding the following to the web config file:
<system.web><pages><controls>
<add assembly="MasterPages" namespace="Microsoft.Web.Samples.MasterPages" tagPrefix="mp" />
<add src="~/sub/TestMasterPage.ascx" tagName="contentcontainer" tagPrefix="mp" />
</controls></pages></system.web>
The following is code for TestPage.aspx that is causing the error:
<%@ language="c#" debug="true" trace="false" %>
<%@ Register TagPrefix="mp" namespace="Microsoft.Web.Samples.MasterPages" assembly="MasterPages" %>
<script runat="server">
void ClickedCapitalize(object o, EventArgs e) {
capitalized.Text = Server.HtmlEncode(tb1.Text.ToUpper());
}
void SayHello(object o, EventArgs e) {
name.Text = Server.HtmlEncode(tb2.Text);
}
</script>
<mp:contentcontainer runat="server" MasterPageFile="sub/TestMasterPage.ascx">
<mp:content id=region1 runat="server">
<a href="MasterPages.htm" runat="server">Relative link test</a><br>
<asp:textbox id=tb1 runat="server"/><asp:button text=Capitalize onclick=ClickedCapitalize runat="server"/>
<asp:literal id=capitalized runat="server"/>
</mp:content>
<mp:content id="region2" runat="server">
<asp:textbox id="tb2" runat="server"/><asp:button text="Say hello" onclick="SayHello" runat="server"/>
Hello <asp:literal id="name" text="[name goes here]" runat="server"/>!
</mp:content>
</mp:contentcontainer>
|
|
|
|
|
classy_dog wrote: Error 1 Could not load file or assembly 'MasterPages' or one of its dependencies. The system cannot find the file specified.
Ok, it was not too clear based on your previous query asked last time, but now:
You are trying/working on an old project and trying to convert/add new features based on ASP.NET 2.0 above. You last project was probably in v1.1
When there was no concept of master pages, people writing your application code at that time, create a custom control/assembly named 'MasterPages' and used that as per need. Now, it looks like you thought/took it as ASP.NET master page and facing issues.
So, to be clear, the assembly in question 'MasterPages.dll' is your custom assembly and not ASP.NET assembly. This assembly is missing and you need to find and provide a reference to it in order to resolve the above errors.
|
|
|
|
|
I have a C# 2010 web form application that I would like to step though the code. I can put breakpoints in the *.aspx.cs files but I can not put breakpoints in the .aspx files. Thus is there any way that I can debug the .aspx pages? If so, can you tell me how to debug the *.aspx pages directly?
|
|
|
|
|
dcof wrote: Thus is there any way that I can debug the .aspx pages?
No. You cannot debug aspx pages. They are not server codes, they turn into plain HTML's.
Further, it's hard to think of a reason on why debugging 'aspx' code would be needed.
|
|
|
|