|
Unless your ASPNET user has the appropriate access, you probably won't be able to set this programatically (and if they do have access, then you won't need to...)
Also, and i could be wrong about this, but will they not need modify rights to delete something?
|
|
|
|
|
How can I know that I have permission to set this programmatically or not ? and you are right about appropriate access for ASPNET user , I checkd that the user ASPNET has fullcontrol access on UserAvatar directory ,but why this error occures in deleting files ?
www.behzadi.net
|
|
|
|
|
Hi All,
I Created a Registration Page with only username,Pwd,Email,Contactno and Address fields.
1.when a Enter user with different Email then it is saved the details in Database.
2.My Code is working fine when a Enter username with Already Existing mail id then it is not taking.But only problem is msg is not displaying client side.
How to display msg .Pls find my code also.
procedure
---------
CREATE Procedure SP_Login
(
@Username varchar(50),
@pwd varchar(50),
@Email varchar(50),
@ContactNo varchar(50),
@Address varchar(50),
@Ret_val Int = Null Out,
@Ret_msg Varchar(75) = Null Out
)
AS
IF EXISTS(SELECT * FROM Login WHERE Email=@Email)
BEGIN
RAISERROR('The email address already exists', 16, 1)
END
ELSE
BEGIN
INSERT INTO Login (Username,pwd,Email,ContactNo,Address)VALUES(@Username,@pwd,@Email,@ContactNo,@Address)
END
If @@Error = 0
BEGIN
SET @RET_VAL = 1
SET @RET_MSG = 'DETAILS INSERTED SUCCESSFULLY.'
END
ELSE
BEGIN
SET @RET_VAL = 0
SET @RET_MSG = 'ERROR : Error in Inserting Details.'
END
GO
codebehind
----------
Try
conObj = New SqlConnection("Data Source=B4B-2F-323-CK26;user id=sa;password=sa;Database=TEST")
conObj.Open()
tranObj = conObj.BeginTransaction
cmdObj = conObj.CreateCommand
cmdObj.Transaction = tranObj
With cmdObj
.CommandText = "SP_Login"
.CommandType = CommandType.StoredProcedure
End With
With cmdObj.Parameters
.Add(New SqlParameter("@UserName", SqlDbType.VarChar, 50)).Value = txtUserName.Text
.Add(New SqlParameter("@pwd", SqlDbType.VarChar, 50)).Value = txtPwd.Text
.Add(New SqlParameter("@ContactNo", SqlDbType.VarChar, 50)).Value = txtPhoneno.Text
.Add(New SqlParameter("@Email", SqlDbType.VarChar, 50)).Value = txtEmail.Text
.Add(New SqlParameter("@Address", SqlDbType.VarChar, 50)).Value = txtAddress.Text
retvalp = .Add("@RET_VAL", SqlDbType.Int)
retvalp.Direction = ParameterDirection.Output
retmsgp = .Add("@RET_MSG", SqlDbType.VarChar, 50)
retmsgp.Direction = ParameterDirection.Output
End With
cmdObj.ExecuteNonQuery()
If retvalp.Value = 1 Then
tranObj.Commit()
lblmsg.Text = retmsgp.Value
Else
tranObj.Rollback()
lblmsg.Text = retmsgp.Value
End If
Catch ex As Exception
Response.Write(ex.ToString())
Finally
If Not tranObj Is Nothing Then tranObj.Dispose()
conObj.Close()
cmdObj.Dispose()
End Try
|
|
|
|
|
I want to draw a selection rectangle on an image object:
1) image normal
2) move mouse over the image
3) click over a point of the image
4) the drag to get a selection rectangle (like selection icons in windows)
How can i do?
|
|
|
|
|
Yes this is possible but quite complicated. You'd need to use Javascript and DOM methods, go look them up, its unlikely anyone will be able to give you code for this.
|
|
|
|
|
Hi,
We are using treeview control(vs.net 2005).For loading the nodes till 2-3 levels its working fine but this treeview is used for populating library books and chapters of each books should be displayed in the next levels when selecting the appropriate book .This takes a lot of time.
Is there anyother way(javascript or any other control) to populate the library details speedly(It needs to be a in a treeview manner),Also selecting each book there shouldn't be any post backs.
Please help me out with a solution.
Thanks & Regards,
Jeeva
|
|
|
|
|
|
Hi there.
In my website, i want to use the a dropdown of all the countries, and together with that, i want to convert the currancy from e.g X to X(country). I need to do this by useing the information of website, that is updated every day, and store that info into a database.
Is this possible? can anyone help me with this task?
Thanks
|
|
|
|
|
There will be something in asp.net like internationalization. I found that in java
|
|
|
|
|
Hi, how can i use the auto documentation tool from microsoft visual studio.net please??
thanks very much for any feedback.
Adrian De Battista - Web Designer, Web Programmer, Software Programmer From Malta. My Website .. www.MaltaTrade.org
|
|
|
|
|
What is the best practice if i want some information to be available in all the forms. Is it good to have global variables. If not then please tell me some other alternative.
Mohinder Singh
|
|
|
|
|
I think one of the best way is creating the datacontainer class and storing there by having private variables and public properties.
There are many ways to store but depends on the size,security ...........
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
can u give me the code for this.
Thanks in advance
Mohinder Singh
|
|
|
|
|
To make sessions you need to create it like this;
Session("Name") = "Adrian"
This Session is now stored with a string called "Adrian". This session can be called from any page you want within the project.
If you want to dispose the session;
Session.RemoveAll()
I hope i helped you in some ways.
Adrian De Battista - Web Designer, Web Programmer, Software Programmer From Malta. My Website .. www.MaltaTrade.org
|
|
|
|
|
You can use sessions also
|
|
|
|
|
how to use session. can u send me the code for it.
Thanks in advance.
Mohinder Singh
|
|
|
|
|
Suppose that I want to send a private message to a person and sender name and reciever name is saved in 2 session variables like this.Session["sender"] and this.Session["Reciever"].
Now I open 2 browser and in browser one ,click on person1 "send message" bottun and go to a page to writing message body, and then in browser 2 click on person2 "send message" bottun and go to a page...!
Now I go to browser 1 and click on "Send" bottun. the value of this.Session["reciever"] is person2 but I want to send message to person 1 .
What should we do in this case ?
|
|
|
|
|
hi all,
In my page,I have to enter only year(eg 1999) in the textbox.but it should be inserted as datetime format in DB.
how to convert year to datetime format in c#.
Eg: 1999 to 1/1/1999 12:00:00 AM
Plz give ur suggestions
thanks in advance
cheers
sangeet
|
|
|
|
|
For Every year the date and time is same ?
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Yes..all the year with same date and time.
I got it by just adding Convert.ToDateTime(@"1/1/" + Year_Tbox.Text)
thanks for ur reply..
cheers
sangeet
|
|
|
|
|
I tried to use below code for my login page. But I am getting below 4 errors which I am unable to resolve. Can you help me please.
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
<br />
namespace WebSite2<br />
{<br />
public class Login : System.Web.UI.Page<br />
{<br />
protected System.Web.UI.WebControls.Label LabelError;<br />
protected System.Web.UI.WebControls.Button ButtonLogin;<br />
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;<br />
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;<br />
protected System.Web.UI.WebControls.Label Label1;<br />
protected System.Web.UI.WebControls.TextBox txtpassword;<br />
protected System.Web.UI.WebControls.Label Label2;<br />
protected System.Web.UI.WebControls.TextBox txtusername;<br />
<br />
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
}<br />
<br />
#region Web Form Designer generated code<br />
override protected void OnInit(EventArgs e)<br />
{<br />
InitializeComponent();<br />
base.OnInit(e);<br />
}<br />
<br />
private void InitializeComponent()<br />
{<br />
this.Buttonlogin.Click += new System.EventHandler(this.Buttonlogin_Click);<br />
this.Load += new System.EventHandler(this.Page_Load);<br />
<br />
}<br />
#endregion<br />
<br />
private void buttonlogin_Click(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
LabelError.Visible = false;<br />
string uid, pwd;<br />
uid = txtusername.Text;<br />
pwd = txtpassword.Text;<br />
string accessLevel = CheckPassword(uid, pwd);<br />
if (accessLevel != "")<br />
{<br />
Session["UID"] = uid;<br />
Session["AccessLevel"] = accessLevel;<br />
Response.Redirect("Page2.aspx");<br />
<br />
}<br />
else<br />
{<br />
LabelError.Visible = true;<br />
}<br />
}<br />
catch (Exception ex)<br />
{<br />
ex.ToString();<br />
}<br />
}<br />
private string CheckPassword(string uid, string pwd)<br />
{<br />
return "1";<br />
<br />
<br />
}<br />
private void btnNewUser_Click(object sender, System.EventArgs e)<br />
{<br />
Response.Redirect("NewUser.aspx");<br />
} <br />
}<br />
}
Below are the Errors.
Error 4 Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). C:\Documents and Settings\Amarnath\My Documents\Visual Studio 2005\WebSites\WebSite2\Login.aspx.cs 1 33 C:\...\WebSite2\
Error 1 'ASP.login_aspx.GetTypeHashCode()': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website2\34e44d00\b8acac28\App_Web_imunwsug.0.cs 870
Error 2 'ASP.login_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website2\34e44d00\b8acac28\App_Web_imunwsug.0.cs 874
Error 3 'ASP.login_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable' c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website2\34e44d00\b8acac28\App_Web_imunwsug.0.cs 192
|
|
|
|
|
For Error 4
PLease check the inherite attribute in the Login.aspx page it should be
WebSite2.Login
Again for errors 1,2 & 3 not have any idea ?
Is it showing for this application only ? or getting problems for other also ?
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Error 1,2,3 are coming up for only this application.
|
|
|
|
|
Hi
I dont know whether this would solve your problem, change access modifier for all button click events to 'protected' (btnNewUser_Click and buttonlogin_Click).
Harini
|
|
|
|
|
I am getting Error in exporting crystal report to pdf
the error is like :
CrystalDecision.CrystalReports.Engine.ExportException...Additional information: Error in File ..*.rpt: Error detected by export dll
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|