|
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
|
|
|
|
|
Do like this.
string str="Hello World";
int countW = str.ToCharArray().Count<char>(c => c == 'w');
Also Read my article for more clear idea on LINQ
Basics of LINQ & Lamda Expressions[^]
I hope this will help you.
|
|
|
|
|
I don't understand completely what do you want but I have written a LINQ expression that will calculate the number or each character in the string:
string hello = "Hello, World!!";
(from fn in
(from ch in hello.ToCharArray()
group ch by ch into g
orderby g.Key
select new Func<object>(() => {
Console.WriteLine(g.Key + ": " + g.Count()); return null;
}))
select fn()).ToArray();
All the characters will be printed to the console.
|
|
|
|
|
Hi frds,
I am using C# and asp.net 2.0 for developing a website admin panel on testing server, as for my concern i need to programmatic( via c# code) replicate database of testing server to database of live server on a button clicked event.
Test server having MS sql server 2005 and live server have MS sql server 7.0 are on same network. can you give a help or suggestion regarding this issue.
Thanks in advance,
Abbas
|
|
|
|
|
Well, this is easy.
Just take a backup using BackUp Command of SQL Server to take backup of database to a location which is accessible from your live server.
http://msdn.microsoft.com/en-us/library/ms186865.aspx[^]
In the live server, copy the file from the network and Restore it.
Generally BackUp and Restore always works for local path. You cant use Unc path to do this. So you need to copy them first to your live server before you restore.
Also there might be some issue with access of the current user, You need might have to do Impersonation to access the unc path(If it is required).
Hope you can do this.
Other than that, You can also take the Help of SMO objects to do this.
But always remember SMO classes are very much Version Specific.
SMO - Manage your SQL Server![^]
cheers.
|
|
|
|
|
hi Ashishek...
Thanks for answer ..i will try it
|
|
|
|