|
encrypt webconfig value of appsetting in asp.net
i am using this code but it Encrypt all Appsetting but i want encrypt only value of Appsetting.
CODE:-
Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)
Dim section As ConfigurationSection = config.GetSection("appSettings")
If Not section Is Nothing And Not section.SectionInformation.IsProtected Then
section.SectionInformation.ProtectSection("DataProtectionConfigurationProvider")
config.Save()
End If
One thing more i want if Administrator fail to modified value of Appsetting through ui then Administrator also change the value of Appsetting through manually can it passable please help me
Piyush Vardhan Singh
|
|
|
|
|
Hi Friends,
I have one doubt,in datagrid i have a button column delete and editcommandcolumn edit link button when i click edit button delete button should be disabled,when i click cancel button delete button should be enable.Can any one tell me please?....if possible tell me the coding..
Thanks & Regards
Senthil Kumar
|
|
|
|
|
Hi,
in the edit event you can find delete button and then disable it.
and same way in delete command.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
HI,
I'm trying to send an email from my web-site, and it's actually working, everything is pretty cool,
but I have this kind of exception:
Send failure: System.Web.HttpException: The "SendUsing" configuration value is invalid. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040220): The "SendUsing" configuration value is invalid. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at Register1.CreateUserWizard1_SendingMail(Object sender, MailMessageEventArgs e) in e:\web\myeconpaper\htdocs\Register.aspx.cs:line 64
The emaiol is sent, but the result label shows me exception,
WHY?
|
|
|
|
|
Repost your exception, kind of hard to follow with the scroll bar.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
here is the exception:
Send failure: System.Web.HttpException: The "SendUsing" configuration value is invalid. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040220): The "SendUsing" configuration value is invalid. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at Register1.CreateUserWizard1_SendingMail(Object sender, MailMessageEventArgs e) in e:\web\myeconpaper\htdocs\Register.aspx.cs:line 64
and here is my code:
protected void CreateUserWizard1_SendingMail(object sender, MailMessageEventArgs e)<br />
{<br />
<br />
CreateUserWizard wizard = (CreateUserWizard)sender;<br />
MembershipUser user = Membership.GetUser(wizard.UserName);<br />
<br />
e.Message.Body = e.Message.Body.Replace("<%PasswordQuestion%>", CreateUserWizard1.Question);<br />
e.Message.Body = e.Message.Body.Replace("<%PasswordAnswer%>", CreateUserWizard1.Answer);<br />
e.Message.Body = e.Message.Body.Replace("<%DomainName%>", Request.ServerVariables["SERVER_NAME"]);<br />
e.Message.Body = e.Message.Body.Replace("<%VirtualDirectory%>", Request.ApplicationPath);<br />
e.Message.Body = e.Message.Body.Replace("<%UserLogsOnAs%>", user.ProviderUserKey.ToString());<br />
<br />
string mail = e.Message.Body.ToString();<br />
System.Web.Mail.MailMessage objEmail=new System.Web.Mail.MailMessage();<br />
objEmail.Body=mail;<br />
objEmail.To = CreateUserWizard1.Email;<br />
<br />
<br />
<br />
try<br />
{<br />
SmtpMail.Send(objEmail);
ResultLabel.Text="Your Email has been sent sucessfully! Thank You!";<br />
}<br />
catch (Exception exc)<br />
{<br />
ResultLabel.Text="Send failure: " + exc.ToString();<br />
}
|
|
|
|
|
asem0525 wrote: "SendUsing" configuration value is invalid
What is the value of SendUsing ?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I don't have it in my entire code.
|
|
|
|
|
Hi,
I was wondering if it was possible to use multi-valued parameters to fill a table in reporting services.
|
|
|
|
|
The question is in the subject.....i can't figure out how to do it
|
|
|
|
|
gates09 wrote: Can I use VB Methods I created in Reporting Services?
What do you mean by "VB Method"? Do you want to use the reporting service in VB project? If yes, the answer is Yes.
|
|
|
|
|
Okay that question is pretty terrible. What i was trying to say was that i have a report in reporting services and i wanted to use a method or function that i created in a class called PackingLabels. The Report and the class are in the same project.
Hopefully this is explained a little better. This happens to me every time i post a question.....i just confuse people.
|
|
|
|
|
My aim is to block the .doc file access through Url.
on IIS, I added a mapping to *.doc. This is a remote server that does not have dotnet installed.
On my application, I put a class which includes ProcessRequest method.
On the web.config, I have added
<add verb="*" path="*.doc" type="DocNamespace.DocClass,DocDllName>;
<add key="PathToRedirect" value="~/Fail.aspx>;
I compiled this class to dll and put it on my bin folder.
Error I find is
"Could not load file or assembly DocDllNameor one of its dependencies. The system cannot find the file specified."
I referred the below
<a href="http://www.15seconds.com/issue/020417.htm">http://www.15seconds.com/issue/020417.htm</a>[<a href="http://www.15seconds.com/issue/020417.htm" target="_blank" title="New Window">^</a>]
Please help.
Thanks
|
|
|
|
|
ss.mmm wrote: This is a remote server that does not have dotnet installed.
Then how are you deploying and running an ASP.NET application?
only two letters away from being an asset
|
|
|
|
|
Sorry, I should have written that the Remote Server has .Net Framework installed and not visual studio.
Thanks
|
|
|
|
|
On my local machine, when I try to access the .doc through browser, it takes me to the Fail.aspx and when I go through the application am able to access.
The problem is with dll. On the remote server, I get the error.
Please help.
Thanks
|
|
|
|
|
Could you please post your code?
|
|
|
|
|
hello
in my project i have long query and i want to breck this query line.
into more than one line.
so how can i use indent.
Gayatri
|
|
|
|
|
Use the _ character ( if you are using VB ). You might want to consider using stored procedures instead.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
thanks for reply.
sir, i am using asp.net 2.0 with c#.
so i want syntax for indent.
actually i have long sql query, i want to breck it in multiple line so i want connector for line or so iwant indent for line.
pls help me.
Gayatri
|
|
|
|
|
In C#, you can end a line with + after the quotation. You must have the next line begin with quotation to continue the string.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Thanku very much
really its helpful for me.
thanks
gayatri
Gayatri
|
|
|
|
|
No problem
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Use Concatenation symbols like + in C# and & in vb.net
Thanks & Regards
Niranjan
|
|
|
|
|
I'm using LINQ to SQL and putting the generated classes inside a separate assembly (not the website project), but it's all part of the same solution. When the tool generates the classes it places the connection string inside an app.config file in the project, but I'd rather have this connection string inside the web.config file for the website.
I've been trying the figure out how to do this and have come across this inside the *.designer.cs file for the LINQ to SQL generated files...
public TopicDatabaseDataContext() : base(global::TMS.Library.Properties.Settings.Default.TopicMappingSystemConnectionString, mappingSource)<br />
{<br />
OnCreated();<br />
}
Now I could replace global::TMS.Library.Properties blah blah with some code to access the connection string in the web.config instead, but since this code is auto generated by a tool, I don't really want to do it this way. Is there a better way?
|
|
|
|