|
Did you miss a return ?
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
|
|
|
|
|
yes,
and prompt box return value in the textbox which user entered.
Eventhough i click on cancel it postback the page and execute my server side code.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
You need to return the result from the disp_prompt function:
function disp_prompt() {
var name=prompt("Please enter assessment name","Assmssent01");
if (name!=null && name!="") {
document.Form1['sname'].value = name;
return true;
}
return false;
}
In the onclick event you need to return the value from the function call to the event. Use lower case names for (X)HTML keywords. Don't use the javascript: protocol in event code, that's for when you put code in an url.
lnkSave.Attributes.Add("onclick", "return disp_prompt();")
Use the type property in the script tag instead of the deprecated language property. You need to use double quotation marks when you put a quotation mark in a string.
Dim strScript As String = "<script type=""text/javascript"">"
Don't use Response.Write to put code in the page. That will place it outside the actual html document, and throws the browser into quirks mode. Use the RegisterStartupScript method to add code to the page.
Page.ClientScript.RegisterStartupScript(Page.GetType(), "msg", strScript)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Sir
Thanks a lot .It works for me.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Hi
we have a web Application which is install on the client
hosting server and it provide a control panel to our client that he can control his client's as Host.
Now i want to update our web application on all clients when new updates come just like the windows or any other software that updates it self how i Can do this
we have lot of clients.
please please help me.....................
Thanx for advance
wasim khan
|
|
|
|
|
|
K thanx Deepak
But my problem is that we create a web application (Like Control Panel)
so that our Hosting Server clients can manage their clients.
Can u please tell me that how i can Update the web application on the hosting server of our client.
One think more when some body purchase our web application we give him the installer to install it in his server
wasim khan
|
|
|
|
|
Something like Plesk/CPanel?
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 is a risk disclosing an application credentials onto a public discussion board.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
For oft, when on my couch I lie
In vacant or in pensive mood,
They flash upon that inward eye
Which is the bliss of solitude;
And then my heart with pleasure fills,
And dances with the daffodils. --William Wordsworth ("Daffodils")
|
|
|
|
|
How dumb can you get, please delete that post like the previous post you should disclose personal details on the forum
We are not a Code Charity
|
|
|
|
|
hay its demo account use for the visitor ok
wasim khan
|
|
|
|
|
Hi all,
I need know whether I could get the HTML of the control before rendering.
For example,
Lets take a ASP MenuItem. I inherits to my own MyMenuItem. I need to add some properties like OnClientClick for which I need the HTML of the MenuItem. Is that possible? If so how to do it (any sample code)
Thanks in Advance
|
|
|
|
|
try this
namespace MyProject.ViewManeger
{
///
/// Summary description for ViewManager
///
public class ViewManager
{
public static string RenderView(string path)//path of the user control
{
return RenderView(path, null);
}
public static string RenderView(string path, object data)
{
Page pageHolder = new Page();
UserControl viewControl = (UserControl)pageHolder.LoadControl(path);
if (data != null)
{
Type viewControlType = viewControl.GetType();
FieldInfo field = viewControlType.GetField("Data");
if (field != null)
{
field.SetValue(viewControl, data);
}
else
{
throw new Exception("View file: " + path + " does not have a public Data property");
}
}
pageHolder.Controls.Add(viewControl);
StringWriter output = new StringWriter();
HttpContext.Current.Server.Execute(pageHolder, output, false);
return output.ToString();
}
}
Rajeev Kr. Sharma
VRI Software Pvt.Ltd.
New Delhi India
HumOnline.com
Stay Connected
|
|
|
|
|
Thanks for replying Rajeev.
But I am talking about Custom controls, but you are saying about User Controls.
Thanks
|
|
|
|
|
Could you not apply the code to custom controls instead?
We are not a Code Charity
|
|
|
|
|
My project runs like this, from page1 I would get the username entered into the textbox.. In page2, I'll be displaying the name of the user based from his username.. Page2 also includes some buttons (like frmPersonalInfo, frmMedicalHistory, etc) that when the user clicks, it will lead them to a more detailed information..
But for example, I have another page (page2.1) and I want to get some value from page2.. It doesn't display anything at all when I'm on page2.1
I'm using a database for data access..
The main purpose of the data access from one form to another is for me to be able to create sql queries..
Code:
Page1
string pcode = txtUser.Text.ToString();
Response.Redirect("frmPage2.aspx?PCode=" + pcode);
Page2
protected void frmPage2_Activate(object sender, EventArgs e)
{
string patientcode = Request.QueryString["PCode"].ToString();
}
protected void btnPersonalInfo_Click(object sender, EventArgs e)
{
Response.Redirect("frmPage2.1.aspx?Code=" + patientcode);
}
Page2.1
protected void frmPag2.1_Activate(object sender, EventArgs e)
{
string code = Request.QueryString["Code"].ToString();
lbl.Text = code;
}
The passing of value from page1 to page2 actually works...
In page2.1, I used a label for try purposes only (lbl).. I just wanted to know if I could display the data there.
But when I run the program, it doesn't display anything eventhough the visibility is set to true..
I'm thinking that maybe because the "patientcode" variable in page2 was initialized not as a global variable.. So, maybe that's why page2.1 displays a null value??
What can you suggest for solution?
Thank you!
|
|
|
|
|
you would be correct. it should have shown an error in your code trying to use patientcode.
BTW you do not need the .ToString() on any of those.
string pcode = txtUser.Text;
Request.QueryString["PCode"];
Request.QueryString["Code"];
its already a string
|
|
|
|
|
This is my 4th bloody day dealing with the insanely stupid installation of T-bloody-F-bloody-S server. After solving a zillion problems (nearly every time having to uninstall and restart ) I've come to this gem:
The identity of application pool 'TFS AppPool' is invalid, so the World Wide Web Publishing Service can not create a worker process to serve the application pool. Therefore, the application pool has been disabled.
I tried changing permissions, I tried creating new users, in the end, before posting this, I set the pool identity to be the domain admin, a no-no for sure but a test to see whether I'm losing it or the software being installed is completely cuckoo, and the beauty I've posted above this paragraph shows up.
Now.
Does anyone have a suggestion before [horror of horrors ]I start from scratch yet again?
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler
"You're an idiot." John Simmons, THE Outlaw programmer
"I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon
|
|
|
|
|
Have you tried this, see toward the end of the thread.
Yusuf
|
|
|
|
|
Yeah, I did. Sadly, it didn't work.
I've started off again with a clean VM, and if this doesn't work, I've got my tech support friend coming over on Friday to get it working.
He's done it several times.
If this doesn't work, I'm taking up farming...
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler
"You're an idiot." John Simmons, THE Outlaw programmer
"I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon
|
|
|
|
|
how can right vigener cipher code withe any language prgramer
|
|
|
|
|
what are you looking for? Vigenere Cipher code in any language? Here is in peril, will that help?
Yusuf
|
|
|
|
|
Hello
I try to send a mailmessage to this mail info@ihacademy.net
i did a form where i specify all the constant of the mail
and this is the code behinder.
"protected void Send_Email(Object Sender, EventArgs e)
{
System.Web.Mail.MailMessage mail = new System.Web.Mail.MailMessage();
mail.To = Request.Form["to"];
mail.From = Request.Form["from"];
if (Request.Form["format"].Equals("text"))
mail.BodyFormat = MailFormat.Text;
else
mail.BodyFormat = MailFormat.Html;
mail.Subject = Request.Form["subject"];
mail.Body = Request.Form["body"];
SmtpMail.Send(mail);
Response.Flush();
Message.Text = "Message Sent...<br><br>" +
"<a href="\"sendMail.aspx\"">Go Back</a>";
}"
I don't have an error but nothing happen and i don't receive any message in the mail.
Any advice or correction will be greatly appreciated
And thanks in advance
Assaf
modified on Tuesday, June 3, 2008 12:30 PM
|
|
|
|
|
If you are using .NET 2.0 you should use System.Net.Mail, but you never set the smtp server you were using, so the code had no idea where to send the message. SmtpMail.Servers.Add is close to what you need. I recomend System.Net.Mail it lets you create a smtp object and control things that way, but if you arent using .NET 2 you wont have it, we had problems with the SmtpMail class in .NET 1.1, sometimes it threw an exception about the server so we had to readd the server using a different method and then it would work.
|
|
|
|