|
currently i m using ASP.NET with C# (.net 2005, 2.0 framework).
Please find the below coding.........
string[] color = new string[] {a,b,c};
foreach (string i in color_parameters)
bg_color(i);
The bg_color() is of.....
public void bg_color(TextBox txtbox_name)
{
................
...............
}
here, when i m trying to pass value to bg_color() "cannot convert from 'string' to 'System.Web.UI.WebControls.TextBox'" error is occuring. how to resolve it?
thanks in advance........
modified on Wednesday, April 30, 2008 5:41 AM
|
|
|
|
|
try
<br />
public void bg_color(TextBox txtbox_name)<br />
{ <br />
txtbox_name.Text = stringvalue;<br />
}
I Love T-SQL
|
|
|
|
|
i would like to convert the "i" value to TEXTBOX.. how to achieve it?
as i mentioned the bg_color() function will receive only TEXTBOX. but the parameter we passing is STRING. so , how to convert STRING to TEXTBOX?
|
|
|
|
|
Are you looking for something like this:
<br />
public void bg_color(TextBox txtbox_name)<br />
{ <br />
string stringvalue = txtbox_name.Text;<br />
<br />
}<br />
<br />
string[] color = new string[] { "a", "b", "c" };<br />
foreach (string i in color)<br />
{<br />
TextBox txt = new TextBox();<br />
txt.Name = i;<br />
txt.Text = i;<br />
bg_color(txt);<br />
}<br />
<code> <br />
<br />
<div class="ForumSig"><hr><small> <font color="Green">I Love T-SQL</font></small></hr></div><br />
<div class="ForumMod">modified on Wednesday, April 30, 2008 5:09 AM</div>
|
|
|
|
|
Something like .ToString() or Convert.ToString(textbox i )
maybe something like that
|
|
|
|
|
no .netman..... i tried many.. but i cant get the answer.. help me.... thanks for ur understanding
|
|
|
|
|
You ought to be more clear in your query. Why do you want to convert string to a Textbox or are you trying to map the string to a specific property of a textbox?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
hello friends
i am having two aspx pages ..one is login.aspx present in rootdirectory and admin.aspx in admin folder
so what i want to do is redirect user from admin.aspx to login.aspx
Example
booking/admin/admin.aspx to booking/login.aspx
Response.Redirect is redirecting it to booking/admin/login.aspx
how to solve this
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
modified on Wednesday, April 30, 2008 4:12 AM
|
|
|
|
|
response.redirect("page.aspx")
|
|
|
|
|
oh...i have said in the post that its not working fine ..
read the last line ...i need to jump back to one folder and give the login.aspx
its like admin/admin.aspx to login.aspx
when i write this ..its doing something like admin/admin.aspx
Please read the post completely
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
"Response.write is redirecting it to booking/admin/login.aspx"
Is different to response.redirect.
Please dont ask me to read the post completely
|
|
|
|
|
Change it to Response.Redirect ..sorry got mess up with codes
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
You need to specify all of the file location not just ~/login.aspx but the entire file location
|
|
|
|
|
Did you try resolving to the parent folder using a .. notation?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
It will be much helpful ...if it is explained with an example
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
well at the moment you might have ~/page.aspx where as you need the whole address
e.g
foldername/website/login.aspx
|
|
|
|
|
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 66.135.197.141:443 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 com.paypal.soap.api.PayPalAPIAASoapBinding.DoDirectPayment(DoDirectPaymentReq DoDirectPaymentReq) at DoDirectPayment.Page_Load(Object sender, EventArgs e) in f:\sample\We\Default.aspx.cs:line 161
i cannot identify this error pls help me
|
|
|
|
|
Also make your subjects a bit more descriptive rather then question, we know you are asking a question, thats why you are posting!
|
|
|
|
|
take alook at this idiot's 18 posts - they are all titled "Question"
|
|
|
|
|
I know I wish this guy could be kicked out the forum to be honest
|
|
|
|
|
am a beginner in .NET CF application development and any help is greatly appreciated...
I am tryin to develop a web service application which could be accessed through a smartphone.
I am using a Windows Mobile 5.0 smartphone emulator in Visual Studio 2005 to debug the application. I could connect to the internet from the smartphone Emulator by cardling the device using ActiveSync 4.5.0. But when I try to access the web service through the emulator i get the following error wheneve a WebMethod is invoked.
I can browse the web service by tying in http://127.0.0.1:2330/[Webservice Name] in the emualtor web browser. it does not work if i used "localhost" instead of 127.0.0.1
System.Net.WebException was unhandled
Message="Unable to connect to the remote server"
StackTrace:
at System.Net.HttpWebRequest.finishGetResponse()
at System.Net.HttpWebRequest.GetResponse()
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
at DirectoryRole_WebService.RoleWS.RoleWS.addRole()
at SmartPhoneApplication.RoleForm.menu2_options_add_role_Click()
at System.Windows.Forms.MenuItem.OnClick()
at System.Windows.Forms.Menu.ProcessMnuProc()
at System.Windows.Forms.Form.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at SmartPhoneApplication.Program.Main()
The inner exception message is "{"No connection could be made because the target machine actively refused it"}
|
|
|
|
|
Please dont double post, just put your error message on the same post as your question
When you type in localhost make sure you are not putting something like ip = , it should be servername = when you use localhost
|
|
|
|
|
Hi i am new for vs2005,
I have used login control in my Home.aspx page
With ref some site, i used the code,
But for me after login its not redirecting to next page.
Getting "Your login attempt was not successful. Please try again." Messgae only,
But my uid and pwd both are correct whats the probs?
This is my code:
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false;
Authenticated=SiteLevelCustomAuthenticationMethod(Login1.UserName,Login1.Password);
e.Authenticated = Authenticated;
if (Authenticated == true)
{ Response.Redirect("Sam.aspx"); }
}
private bool SiteLevelCustomAuthenticationMethod(String UserName, String Password)
{
bool boolReturnValue = false;
String strConnection = "Server=(local);database=WorkOut;uid=sa;pwd=bumi;";
SqlConnection Connection = new SqlConnection(strConnection);
String strSql = "Select * From UserLogin";
SqlCommand SqlCmd = new SqlCommand(strSql, Connection);
SqlDataReader SqlRd;
Connection.Open();
SqlRd = SqlCmd.ExecuteReader();
while (SqlRd.Read())
{
if((UserName == SqlRd["Name"].ToString())&(Password == SqlRd["Password"].ToString()))
{
boolReturnValue=true;
break;
}
}
SqlRd.Close();
return boolReturnValue;
}
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
did you dibug you code ?
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
what to debug in that?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|