|
hy,
if i want to insert data into the data base .can i do it using web services file.why a resx file is created once i insert a control into the design of .cs file
|
|
|
|
|
resx file is just to store resources, which may be some images, scripts etc. It comes with WebApplications which includes resources for every web form. Otherwise a single resource portion always exists inside your assembly. You can easily make use of that from your web applications.
And hey Web services can be used to save data, just need to call the web method that will be doing this for you.
Abhishek Sur
|
|
|
|
|
Hi
Currently the default database for the asp.net login control stores the lastactivitydate for the user, i.e the last time they logged in using the login control.
Is there a way to record each time they logged into the database?
thanks
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
The asp.net login control uses the MembershipProvider to authenticate the user. Using the System.Web.Security.Membership.ValidateUser() method to authenticate the user will automatically update the lastactivitydate field when authenticating the user.
|
|
|
|
|
So to repeat my question, is there a way to log in the database a new record each time a user logs in?
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
Sure, if you are using the login control then implement the Authenticate event of the Login control. Else do it whereever you are authenticating your user. I think the code below does what you want to accomplish:
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
string Username = this.Login1.UserName;
string Password = this.Login1.Password;
if (Membership.ValidateUser(Username, Password))
{
Audit.Login.Log(Username, Audit.Login.eStatus.Success, Audit.Login.eSource.AdminSite);
e.Authenticated = true;
}
else
{
Audit.Login.Log(Username, Audit.Login.eStatus.Fail, Audit.Login.eSource.AdminSite);
e.Authenticated = false;
}
}
Hope this helps.
|
|
|
|
|
bcozican wrote: Audit.Login.Log(Username, Audit.Login.eStatus.Success, Audit.Login.eSource.AdminSite);
What does the Audit stand for?
Do I have to delcare this else where in my class?
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
The .Net Membership doesnt have build in auditing so you will have to create a log table and classes to log data in it yourself. Audit.Login.Log() is my own function that I created to log the audit entry.
|
|
|
|
|
Ah ok. Thanks for that.I will give it a go.
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
i want go to a url in javascript
c#.net: response.redirect("http://....")
in javascript: ?????
|
|
|
|
|
window.open("http://....");
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
It will open the window as popup !!!
cheers,
Abhijit
|
|
|
|
|
Yes, sorry for that. it was my mistake
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
no i dont want open a new page
function move()
{
i think its window.location = "http://...."
}
has it ; in the end or not
and when i want to call it i how should i write?
onclick=javascript:move();
|
|
|
|
|
change window.location.href
Cheers!!
Brij
|
|
|
|
|
use this
<script type="text/javascript"><br />
<!--<br />
window.location = "http://www.codeproject.com/"<br />
</script>
and Here is
5 different way[^]
cheers,
Abhijit
|
|
|
|
|
Hi friends,
I am using .NET 2008 version. I want to include my js files, but not by standard way like '<script type="text/javascript" src="scripts/companyname/main.js"></script>' but from .cs file.
The problem is in above example, "companyname" can change and its comming from another xml file, which i am reading in .cs, so i have to give source of js file in cs.
I have found 1 function "RegisterClientScriptInclude" in C#, but its not working. Please any one can help me to perform my task or please show me how to use "RegisterClientScriptInclude" function.
Thanks for any help in advance. Happy Coding.
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
Hi Anand,
try this line of code where u r currently writing the RegisterClientScriptInclude function,replace with this
ClientScript.RegisterClientScriptBlock(typeof([ur .cs classname here]),"one"," ");
company name is a variable that will include the name from ur xml file
hope it helps
Rajeesh K
|
|
|
|
|
Thanks Rajeesh,
It is another good and shorter way, let me try by urs way, it'll save my time.
Thanks for help.
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
Thanks, your code helped me to include css file also, i was not able to include css file through cs by my code.
All i did is:
protected void Page_Init(object sender, EventArgs e)
{
Servicepath = "xmls/saltours/general/services.xml";
string jspath = "scripts/companyname/main.js";
String csname = "PageLoadScript";
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptInclude(cstype, csname, ResolveClientUrl("~/" + jspath));
ClientScript.RegisterClientScriptBlock(typeof(PackageList), "one", "<link href="\"styles/companyname/style.css\"" type="\"text/css\"" rel="\"Stylesheet\"" />");
ClientScript.RegisterClientScriptBlock(typeof(PackageList), "two", "<link href="\"styles/companyname/st_home.css\"" type="\"text/css\"" rel="\"Stylesheet\"" />");
}
and I got what was required....
Thanks,
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
Dont bother for this question friends, i have solved it myself. all i did is:
string jspath = "scripts/" + this.company + "/main.js";
String csname = "PageLoadScript";
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptInclude(cstype, csname, ResolveClientUrl("~/" + jspath));
Thanks friends and use this if any one is faciong this problem.
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
just rember one more thing, when you have AJAX on that page you have to use ScriptManager, insted of ClientScriptManager
cheers,
Abhijit
|
|
|
|
|
Thanks buddy
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
how do i use this by using system.web.mail
or
system.net.mail;
any code sniptte that will help
please give me .
thanks in advance
|
|
|
|
|
Well, as your question is somewhat obscure, try google.
Bob
Ashfield Consultants Ltd
|
|
|
|