|
If I'm not wrong, I think you must specify the full path like so
<customErrors mode="on" defaultRedirect="~/Oops.aspx" />
HTH!
|
|
|
|
|
I have tried that.
Do I need to change something in IIS?
|
|
|
|
|
I don't remember making changes on IIS 6, but I've no idea about IIS7.
|
|
|
|
|
Hi guys,
I am new to the ASP.NET framework and was wondering if you could help me out a little bit please!
I am using the ASP.NET MVC framework. I have a controller file for home, HomeController.cs and a aspx file under the Home directory.
My question is - if I have an element (say a label) in my Index.aspx (under Home directory) file - is there a way to access it from the HomeController.cs file? I have seen a tutorial simply use the id of the element to access it - but this doesn't work for me.
Is there a proper way to access form elements (or elements in general) directly from the controller file?
<asp:Label id="lblMessage" Text=" " runat="server" />
lblMessage.Text = message;
Thank you very much for your help!
Xav.
|
|
|
|
|
I'm no expert in MVC but, my understanding is that controller and view should have the same name. But that's just my understanding and I could be wrong.
HTH!
|
|
|
|
|
Hi,
Thank you for your reply!
They are correctly matched and all - just cannot seem to see any elements coming up on the view page
|
|
|
|
|
Hi,
To this in Asp.Ne MVC, i think it's really hard but you can also look at "ViewPage" class.
However you can use the View Code behind like this:
- Add a new class in Controllers "Index.cs"
namespace MvcApplication1.Controllers
{
public partial class Index : ViewPage
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Label lbl= (Label)this.FindControl("lblMessage");
lbl.Text = "Yahoooo!";
}
}
}
- Open your View (in this example is Index.aspx) and update the derectives page:
<%@ Page Language="C#" Inherits="MvcApplication1.Controllers.Index" CodeBehind="~/Controllers/Index.cs"%>
as you can see, you specify the CodeBehind class and you Inherit from it (like the Old asp.net)
- Add this method in the "HomeControler" Class:
public ViewResult Index()
{
return View();
}
Good luck.
Kadaoui El Mehdi
|
|
|
|
|
I m using web service of third psrty.when i using this from devlopement server,it work fine but when i host on web server,then i got problem which given below:
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A socket operation was attempted to an unreachable host 202.54.158.89:80 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at BSWS.BSWS.SubmitSMS(String strID, String strPwd, String strPhNo, String strText, String strSchedule, Int32 intRetryMin, String strSenderID, String strSenderNo) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\395905b2\d466df68\App_WebReferences.aq-glseu.0.cs:line 147 at Default2.SendSMSUsingBS(String strUser, String strPassword, String strRecip, String strMsgText, String strSMSScheduleDate) in d:\whb\Sites\19229\Web\Default2.aspx.cs:line 91 at Default2.sendSMS() in d:\whb\Sites\19229\Web\Default2.aspx.cs:line 77 at Default2.Button1_Click(Object sender, EventArgs e) in d:\whb\Sites\19229\Web\Default2.aspx.cs:line 42
|
|
|
|
|
An aspx page called Default2.aspx tried to process Button1 click event. It has tried to connect via SOAP protocol to the host 202.54.158.89:80 to send an SMS. But the connection was denied.
Something like firewall can cause this problem by blocking a connection.
|
|
|
|
|
Adding to Dmitry's comments -
To confirm it, just try connecting to the host at 202.54.158.89:80 using a browser from your live server.
|
|
|
|
|
Your reply thread went to Dmitry instead of the original asker.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Member 2328095 wrote: 202.54.158.89
From the web server box, were you able to ping this host? If you are getting something like 'Destination host unreachable ', you would need to consult the network administrator for adjustments.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
hi,
how to convert existing word document to pdf in asp.net
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
|
thanks for ur reply..
i have another doubt.
is is possible to open word document in asp.net??
for example when i trigger in button its showing word application.
it is possible ???...
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
|
Respected,
I have taken DropDownList and checkBox control in a Grid
problem is when dropDown select of specific GridView row
the CheckBox on the GridView selected row should
be unCheck Please help me.
Thanks
|
|
|
|
|
From : Accessing the different controls inside a GridView control[^]
foreach (GridViewRow row in GridView1.Rows)
{
string textBoxText = _
((TextBox)row.FindControl("TextBox1")).Text;
Response.Write(textBoxText);
string dropDownListText = ((DropDownList)
row.FindControl("DropDownList1")).SelectedItem.Value;
Response.Write(dropDownListText);
ListBox myListBox = (ListBox)row.FindControl("ListBox1");
foreach(ListItem selectedItem in myListBox.Items)
{
if (selectedItem.Selected)
{
Response.Write(selectedItem.Value);
}
}
}
|
|
|
|
|
Hi,
I think you can do something(such as JS function) when the selectedchanged event of the dropdownlist occurs.
Then you should select the correct row and checkbox. You can bind them together when your table is created.
modified 27-May-14 4:58am.
|
|
|
|
|
Hi friends...
am created business intelligence application in sql2005 ..so report created successfully but when i am deploying that report to my localhost server.am getting "A Connection could not be made to the report server http://localhost/ReportServer"..
Please Help me...
txs in advanve....
|
|
|
|
|
Hi guys i am new to generics,
i want to read a line and print the each words how many times it occurs using generics...,
For eg:
If i have a string "Hi world, welcome"
in tht string i want to print total number of character count and
'w','o','l','m' how many times occured the each character in tht string..,
help me out in thius,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
what is the problem with that, use foreach loop to calculate.
string str = "Hi world, welcome";
foreach (char s in str)
{
}
|
|
|
|
|
u cant use for loop,
i need using generics,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
I cant get you properly.
foreach works on Enumerable which is the basis of Generics.
Let me know what exactly you are looking for... do you need to use LINQ ?
Generics are used to define objects, it is no means related to its manipulation (loops)
|
|
|
|
|
Sorry i didnt mention properly,
S have to use LINQ too...,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|