|
I want to read the security key value from App.config file. Below is the procedure which I did :
Create a new config file name as App.config
In the App.config file:
Added this:
<appsettings>
<add key="SecurityKey" value="MyNewKey">
After that I did the following:
System.Configuration.AppSettingsReader settingsReader
= new AppSettingsReader();
when i am debugging these, i find that the value of dimension is 0 which supposed to 1. since there is one key-value present in the App.config
string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));
Also it's throwing an exception stating
“The key "SecurityKey" does not exist in the appSettings configuration section”.--which already present in the App.config.
Also i tried with the second scenario:
string key =
System.Configuration.ConfigurationManager.AppSettings["SecurityKey"];
which giving me the key value null.
Do i required to do some setting for reading the "SecurityKey" Value?
Needs help!
Thanks
Sudhir Kumar
Sudhir Kumar
|
|
|
|
|
I think you can get it like this:
ConfigurationSettings.AppSettings.Get("key")
Best Regards,
Apurva Kaushal
|
|
|
|
|
DON'T CROSS POST
only two letters away from being an asset
|
|
|
|
|
I want to read the security key value from App.config file. Below is the procedure which I did :
Create a new config file name as App.config
In the App.config file:
<configuration>
<appsettings>
<add key="SecurityKey" value="MyNewKey">
After that I did the following:
System.Configuration.AppSettingsReader settingsReader
= new AppSettingsReader();
when i am debugging these, i find that the value of dimension is 0 which supposed to 1. since there is one key-value present in the App.config
string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));
Also it's throwing an exception stating
“The key "SecurityKey" does not exist in the appSettings configuration section”.--which already present in the App.config.
Also i tried with the second scenario:
string key =
System.Configuration.ConfigurationManager.AppSettings["SecurityKey"];
which giving me the key value null.
Do i required to do some setting for reading the "SecurityKey" Value?
Needs help!
Thanks
Sudhir Kumar
Sudhir Kumar
|
|
|
|
|
If your web.config appSettings sections looks like the following:
<appsettings>
<add key="SecurityKey" value="my new key">
You can then use ConfigurationManager.AppSettings["SecurityKey"] to access it.
Hope this helps.
.leON.
|
|
|
|
|
Hi,
In Itemdatabound event of grid
I want to hide row if preceding row contain some conditional data.
I mean
sub itemdatabound(s As Object, ByVal e as DataGridItemEventArgs)
If e.Item.ItemType = ListItemType.Item Then
If e.Item.Cells(2).Text = "Hide next" Then
hide next row of grid
end if
end if
end sub
I hope someone help me.
Regards,
Nagraj
|
|
|
|
|
e.Item.Visible=false;
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks for reply,
But
This code will hide same row.
I want to hide next row means from if 2nd row is having test "Hide next" 3rd row should hide completely
|
|
|
|
|
In that case what you can do is to take a boolean variable and then when you meet the requirement then boolean variable to true and then check for that boolean vale and make that particular row hidden. isn't it?
Best Regards,
Apurva Kaushal
|
|
|
|
|
sub itemdatabound(s As Object, ByVal e as DataGridItemEventArgs)<br />
If e.Item.ItemType = ListItemType.Item Then<br />
If e.Item.Cells(2).Text = "Hide next" Then<br />
e.Item.Visible = False<br />
end if<br />
end if<br />
end sub
==postmaster
http://www.programmingknowledge.com/[^]
|
|
|
|
|
Thanks for reply,
But
This code will hide same row.
I want to hide next row means from if 2nd row is having test "Hide next" 3rd row should hide completely
|
|
|
|
|
hi! i creates a html page as below. it works properly
<title>Untitled Page
function f()
{
// Declare the variables
var Excel, Book;
// Create the Excel application object.
Excel = new ActiveXObject("WINWORD.Application");
// Make Excel visible.
Excel.Visible = true;
// Create a new work book.
Book = Excel.Workbooks.Add()
// Place some text in the first cell of the sheet.
Book.ActiveSheet.Cells(1,1).Value = "This is column A, row 1";
// Save the sheet.
Book.SaveAs("C:\\TEST.XLS");
// Close Excel with the Quit method on the Application object.
Excel.Application.Quit();
}
but when i put this code in an aspx page, using VS.NET 2005, then generates an error ...
[Microsoft JScript runtime error: Automation server can't create object]
what is the problem?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<title>
function f()
{
// Declare the variables
var Excel, Book;
// Create the Excel application object.
Excel = new ActiveXObject("Excel.Application");
// Make Excel visible.
Excel.Visible = true;
// Create a new work book.
Book = Excel.Workbooks.Add()
// Place some text in the first cell of the sheet.
Book.ActiveSheet.Cells(1,1).Value = "This is column A, row 1";
// Save the sheet.
Book.SaveAs("C:\\TEST.XLS");
// Close Excel with the Quit method on the Application object.
Excel.Application.Quit();
}
|
|
|
|
|
Here i had a problem that,when i click button it should move to the next,like to the end of the data table.with datareader i can read at a time and display,
but i have to do this each time when button was clicked.
give me a suitable example.
thanks in advance
kissy
|
|
|
|
|
put the data in the dataset and then move your records accordingly.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hello everybody,
I am alex,i need your help.in my project i want to list all the file names contained in a server for example if i connect the server through code after connection established i want to see the file names of that server in my project...i know it's little difficult but if u have some idea pls let me know.....alex.
alex.
|
|
|
|
|
Hai,
i want to make a button's visible property false by using a javascript function.i mean i want to create a javascript function in .aspx file. in that function i want to write code to make a button's visible property false and i want to call this function in another button's onclick event from .aspx file itself.how can i do?
please give me a reply?????????....
Anu
anu
|
|
|
|
|
anujose wrote: i mean i want to create a javascript function in .aspx file.
function tt()
{
}
anujose wrote: in that function i want to write code to make a button's visible property false
document.getElementById("Button2").style.visibility="hidden";
anujose wrote: i want to call this function in another button's onclick event
Button1.Attributes.Add("onclick","javascript:return tt();");
Hope this will serve the purpose.
Best Regards,
Apurva Kaushal
|
|
|
|
|
I Have a doubt in javascript..
<body contentEditable=true>
<div > .......</div>
<div>.........</div>
</body>
In the Above javascript i want to set the display Attributeto "none" for all div tags,but its not working because of the Attribute(contentEditable) given in parent tag(body)..is there any solution to make the child tag(div tag) display="none" when parent have contentEditable Attribute...
Help me out to hide the div tag..
|
|
|
|
|
I Have a doubt in javascript..
.......
.........
In the Above javascript i want to set the display Attributeto "none" for all div tags,but its not working because of the Attribute(contentEditable) given in parent tag(body)..is there any solution to make the child tag(div tag) display="none" when parent have contentEditable Attribute...
Help me out to hide the div tag
|
|
|
|
|
Posting it multiple times and in multiple forums doesn't gurantee the early response.
Best Regards,
Apurva Kaushal
|
|
|
|
|
hello All,
I am working on server automation of PowerPoint through ASP.NET.After every few days I start getting error
"Exception Details: System.Runtime.InteropServices.COMException: Server execution failed ". It comes in the line where I create the application object i.e.
PowerPoint.Application pptApp = new PowerPoint.ApplicationClass();
Can anybody explain me why is it happening? Till now everything was working properly and suddenly this error started coming up.
Last time when I encountered this error i had to get PowerPoint reinstalled on my server machine, after which error disappeared, which I feel now is not an appropriate solution.
Please help!
Thanks,
Avanika
|
|
|
|
|
Hello
pls check your com references.
dolly
|
|
|
|
|
hi all i want to knw hw to use the repeater control and wht are the benefits of it
thank u all
abdelhameed81
|
|
|
|
|
|