|
Have a look at the ASPNET user on your local machine. You can make some changes to this user within the machine.config. Google will help you how to do this.
|
|
|
|
|
Hi Expert,
I would like to ask a question, “Can I share session variable between two virtual directories in ASP.net 2.0. If possible then how can I achieve?
Any help is appreciated.
Regards,
Rajesh
rajesh
|
|
|
|
|
Hi,
I have built my own authentication system which uses a cookie to save the info about the user. All works fine until I want to retrive the info from the cookie. If the name of the cookie is the same as FormsAuthentication.FormsCookieName, the cookie cannot contain any value I want, because if the cookie contains any nonvalid values then the cookie will not show up in the Request.Cookies collection. I first put the value “a” in the cookie, and all works fine, then “b”, works fine, but if I combines them , “ab”, then the cookie wont show up in the Request.Cookies collection. What values can the auth cookie contain?
(ASP.NET 2.0)
Below is the code to test this.
Default.aspx:
<br />
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" Title="Untitled Page" %><br />
<html><br />
<head><br />
<title>test cookie</title><br />
</head><br />
<body><br />
<form id="form" runat="server" action="test.aspx"><br />
<asp:label id="cookievalue" runat="server"></asp:label><br />
<asp:button text="set cookie" id="setcookie" runat="server" OnClick="setcookie_Click" /><br />
</form><br />
</body><br />
</html><br />
Default.aspx.cs
<br />
using System;<br />
using System.Web;<br />
using System.Web.Security;<br />
<br />
public partial class _Default : System.Web.UI.Page <br />
{<br />
private string _cookieName;<br />
<br />
public _Default()<br />
{<br />
_cookieName = FormsAuthentication.FormsCookieName;<br />
}<br />
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (Request.Cookies[_cookieName] == null)<br />
{<br />
Label1.Text = "no cookie";<br />
}<br />
else<br />
{<br />
Label1.Text = Request.Cookies[_cookieName].Value;<br />
}<br />
}<br />
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
setCookie();<br />
Response.Redirect(Request.Url.PathAndQuery);<br />
}<br />
<br />
private void setCookie()<br />
{<br />
HttpCookie cookie = new HttpCookie(_cookieName, "ab");<br />
cookie.Expires = DateTime.Now.AddDays(7);<br />
Response.Cookies.Add(cookie);<br />
}<br />
}<br />
|
|
|
|
|
hi its me again.
i am fellowing a read me file and this is one of the steps.
Open web.config in the root folder of the application and edit the DatabaseString line. Change the SERVER, DATABASE, USERNAME, and PASSWORD options to match an account that has administration rights to your SQL Server (i.e. the 'sa' account). This account will only be used during setup to create the tables.
i tryied to do this but it always says login fail.
<br />
<br />
add key="DatabaseString" value="Provider=SQLOLEDB;Data Source=SERVER;database=DATABASE;uid=USERNAME;pwd=PASSWORD;" /><br />
add key="DatabasePrefix" value="DMG" /><br />
<br />
does any one know any built in user id that sql server sure have?
or can giv me instuctions on how to find one?
|
|
|
|
|
eval is the system defined method in Javascript.It will return the object if a string is passed as argument.
Eg eval("Textbox1")returns me the control object.Is there any equvalent method in ASP.Net?
|
|
|
|
|
No.
There are other ways of doing similar things, depending on what you want to do really. You have access to the compiler dll, so you can actually compile code in the runtime. You can use reflection to create objects if you know the class name, and to access members of objects. If you want to find a control in the current page, there is a FindControl method.
---
b { font-weight: normal; }
|
|
|
|
|
I am converting a DELPHI application to VB 6.0. Language in the DELPHI Project is PASCAL. In the application coder has created a TMemoryStream type. I just want to know what is its equivalent in VB 6.0
The complete code is -
<br />
function TForm1.BackupFinger():integer;<br />
var<br />
bRet:boolean;<br />
iRet:integer;<br />
jh:integer;<br />
dwMachineNumber,dwEnrollNumber,dwEMachineNumber,dwBackupNumber:integer;<br />
d1,d3:longint;<br />
buf: array[0..800] of longint;<br />
m:TMemoryStream;<br />
begin<br />
jh := StrToInt(cbJh.Text);<br />
d1 := 0;<br />
d3 := 0;<br />
dwMachineNumber := jh;<br />
dwEnrollNumber := qfp.FieldByName('dwEnrollNumber').Value;<br />
dwEMachineNumber := qfp.FieldByName('dwEMachineNumber').Value;<br />
dwBackupNumber := qfp.FieldByName('dwBackupNumber').Value;<br />
bRet := FPKeeper1.GetEnrollDataB(dwMachineNumber,dwEnrollNumber,dwEMachineNumber,dwBackupNumber,d1,buf[0],d3);<br />
if bRet = true then<br />
begin<br />
m := TMemoryStream.Create;<br />
m.Position := 0;<br />
iRet := m.Write(buf,800);<br />
qfp.Edit();<br />
qfpdwEnrollData.LoadFromStream(m);<br />
qfp.FieldByName('dwPassWord').Value := d3;<br />
qfp.FieldByName('Memo').Value := 'Backuped';<br />
qfp.Post();<br />
m.Free;<br />
BackupFinger := 1;<br />
end<br />
else<br />
begin<br />
BackupFinger := 0;<br />
end<br />
end;<br />
Please help if someone has any idea about this.
Thanks
|
|
|
|
|
Hi,
I Have a window 2003 server machine. I Installed visual studio.NET 2003 on my machine.
In Microsoft visual studio .NET 2003 a error is occured ,
when I want to create a new project in ASP.NET Web
Application visual studio .net has dected that the web
server is runing ASP.NET version 1.0.
The web application you are creating or opening can be
configured to be complaint with ASP.NET 1.0 .
however , the application will not able to use new
features from ASP.NET 1.1 .
So I can't work on my machine for Dot Net .
Plz sugess me for this .
Thanks all off u .
nilesh
|
|
|
|
|
On the run or command prompt
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe
assuming that windows is installed on ur C:\ drive
this will update the framework version
Hope it would help
Best Regards
3ala2
|
|
|
|
|
Thanks , But Problem is same.
nilesh
|
|
|
|
|
hi,
Iam having an application with some text on a lable.
Displays pop-up box with text box when mouse appears over lable and we will make a note on the text box and close the popup.Next time when the mouse appears over the lable ,popup should open with text what we tiped Earlier. can any one help on this topic.
kamalnath
|
|
|
|
|
Solution1 :- Enable view state of the control,so that the value is retained.The popup containing textbox should in the same page where the label is present.This will help u in retaining the contents.
Solution2 :- Store the data in a hidden box and reload the control again with the contents.
|
|
|
|
|
Hi,
I want to split a sentence and put each word into a row of ListBox by using Javascript.
Does anyone know how to do that?
Thanks,
|
|
|
|
|
try this
for (var i = 0; i < states.Tables[0].Rows.length; ++i)
{
document.getElementById("ddlState").options[document.getElementById("ddlState").options.length] = new Option(states.Tables[0].Rows[i].StateName, states.Tables[0].Rows[i].StateId);
}
or
document.getElementById("ddlState").options[0] =value;
Ashutosh kumar
|
|
|
|
|
Hi Ashutosh,
Thank you for your reply.
Can I please know what "ddlState" is? Is it the name of the Listbox I want to display the words, or the control that has the sentance?
If it is the Listbox, where can I pass the sentance? And should I use something to split the sentance first?
Thanks,
|
|
|
|
|
yes ddlState is a id of dropdownlist.
value is a variable through which we can insert data into list.
Aashutosh Kumar
|
|
|
|
|
Hi Ashutosh,
Sorry, I'm still not very clear about these codes
Does it work the same for ListBox as well?
So what is "states"? Is it a name of a talbe or a DataSet or something?
Aashutoshkumar wrote: for (var i = 0; i < states.Tables[0].Rows.length; ++i)
What about "StateName" and "StateId"? Are these some kind of a property or it will be the Name and ID of the DataSet?
Aashutoshkumar wrote: document.getElementById("ddlState").options[document.getElementById("ddlState").options.length] = new Option(states.Tables[0].Rows[i].StateName, states.Tables[0].Rows[i].StateId);
How about the "or" is it a part of the code or it's the next line of the code will do the same thing as the codes above, so it is another option for me?
Aashutoshkumar wrote:
or
document.getElementById("ddlState").options[0] =value;
Thank you for answering me. And sorry about the trouble, without understanding them I can not modify them and customise into my codes.
Thanks again,
|
|
|
|
|
Hi,
I run a web portal where people buy tickets online. I am interested in taking their feedback 2 days after their journey. This requires me to send mails everyday to get their feedback.
I created a HTML format mail which can be sent. As of now, Everyday I use a small web page and a submit button to send mails to those who have travelled. But How can I automate or schedule so that these mails are sent regularly.
Is there any scheduler or can we do any automation in ASP.NET?
Thanks
-Sudhakar
|
|
|
|
|
Hi Sudhakar,
I have a suggestion. Create console application and write a code for Send Mail In C#
Like
using System.Web.Mail;
using System.Windows.Forms;
// Create a function
public SendMail()
{
MailMessage objMail = new MailMessage ();
objMail.From = "ABC@gamil.com"
objMail.To = "PQR@gmail.com;
objMail.Subject = "This is Test Mail;
objMail.BodyFormat = MailFormat.Html ;
objMail.Body = "Hi ,This is a test mail for you;
try
{
SmtpMail.Send (objMail);
}
catch (System.Web.HttpException exHttp )
{
MessageBox.Show("Exception occurred:- " + exHttp.ToString() ) ;
}
finally
{
objMail = null;
}
}
Write Body in HTML Format.A good idea is store all email who have travelled in XML and read from XML and send Mail to Client.
To schedule sending email every day .Windows schedule help you.I Mean to say you can shedule exe in windows schedular.If u need code then let me know i will send.
I hope this will you.
rajesh
|
|
|
|
|
How do u shedule exe in windows schedular.Colud u pls send code for the same.
Thanks Mini
|
|
|
|
|
To add the application to the Task Scheduler .Go to ControlPanel/ScheduledTasks.
Regards
rajesh
|
|
|
|
|
Hello Rajesh,
Is there any way we can achieve the same through coding instead of accessing the control panel
Thanks,
Mini
|
|
|
|
|
whn i press Enter Key in a textBox thn i call a particular Button_click. so how can i call give me suggestion.
Smile a lots its cost nothing so Keep smiling.
Deepak
|
|
|
|
|
Hi there,
You can set the defaultbutton for your page in the <form> tag. Whenever you press the Enter key in a web page (from you TextBox), You can call a particular Button's Click event.
Another way to fire a "click" event of LinkButton based on pressing enter in a text field. It works OK in IE and Firefox only. Here, LinkButton1 is a linkbutton .
TextBox.Attributes.Add("onKeyPress", "javascript:if (event.keyCode == 13) __doPostBack('" + LinkButton1.UniqueID + "','')");
Regards,
Jay
|
|
|
|
|
Hello,
I tried using your code ,I have written Response.write in the click event of button
private void LinkButton1_Click(object sender, System.EventArgs e)
{
Response.Write("I have pressed Enter Key");
}
However there is nothing displayed as i press enter key in Textbox.
Thanks,
Mini
|
|
|
|