|
Hi,
thats true.
But what my question is.
If we can solve it without using viewstate then why to use it ?
Bcoz smart coding it this.
Anyways good to hear that my method can work.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
How about using a DIV tag and writting a javascript to toggle the DIV on the click of Link button?
function ToggleDIV(divid) {
if (document.getElementById(divid).style.display == 'none')
document.getElementById(divid).style.display="inline";
else
document.getElementById(divid).style.display="none";
}
- Regards - JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
I have a checkbox list that is being populated by a database object. User should be able to select more than one option from the checkbox list....now I wanna be able to grab all the values that the user is selecting and be able to put them into a variable....now since there could be more than one value that a user may select, I can't put save them into a string variable...it has to be a string array or something along those lines...to be able to hold multiple variables. Now can someone please post something on here that shown me how to do that.
Thanks
|
|
|
|
|
Hi,
you can use ArrayList and can add selected values in the ArrayList.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Use a generic List<> , which will be type safe. Check this
List<string> objList = new List<string>();
foreach (ListItem item in CheckBoxList1.Items)
{
if (item.Selected)
objList.Add(item.Text);
}
|
|
|
|
|
Hi there, thanks for the speedy response... well I just started out with .Net so I really didnt know about
these generic classes in 2.0, thanks for pointing out, I looked at them and the sample code you posted,
Following is what I kinda came up with.
//Member Level variable
string mJurisdictionSelected = null;
protected void GetUserSelectedValues()
{
string dateSelected = this.mDateRestrictor.SelectedItem.Value.ToString();
//this.dateTest.Text = dateSelected;
//for (int num = 0; num < mJuristictionCheckBoxList.Items.Count; num++)
//string[] jurisdictionName;
string jurisdictionName = null;
System.Collections.Generic.List<string> list = new System.Collections.Generic.List<string>();
foreach (ListItem item in this.mJuristictionCheckBoxList.Items)
{
//ArrayList jurisdictionName = new ArrayList();
if (item.Selected)
{
list.Add(item.Text);
//jurisdictionName = item.Text.ToString();
// this.StateTest.Text = jurisdictionName.ToString();
}
}
this.mDateSelected = dateSelected.ToString();
if (!string.IsNullOrEmpty(jurisdictionName))
//this.mJurisdictionSelected = jurisdictionName.ToString();
this.mJurisdictionSelected = list.ToString();
}
Now as you can see, after retrieving the values (from drop down) into string variable dateSelected
and from checkboxlist into string variable mJurisdictionSelected, I need to pass them to our company's
middle tier folks...so thats why I'm putting them in member level variables....the question regarding
the implemenation you showed me is that " should I just create System.Collections.Generic.List as a member
level thing, outside of the function and then directly keep the values into the list of type System.Collections.Generic.List.
Instead of putting them into string mJurisdictionSelected? I mean the issue is that user could be selecting more than one
value from the checkbox list so is this implemenation you told me about would be able to hanle more than one entry selected
by user in the checkbox list?????? Or do I need like an array or something??? Please help??
Thanks
Sam
-----------------------------
If you don't go after what you want, you'll never have it.
If you don't ask, the answer is always no. If you don't step
forward, you're always in the same place. -Nora Roberts
|
|
|
|
|
Hi there,
What is the difference between App_GlobalResources and App_LocalResources - I am able to place a file (say tmp.txt) under App_LocalResources and still access it from every aspx file.
thx.
|
|
|
|
|
Hi my dears,
Im developing a website in VS2005,
in one of my pages I have 3 UpdatePanels and in eache one I`ve used some server controls. In UpdatePanel1 I have a PlaceHolder server control that I add some Labels to it in runtime . When I run my website these labels will be added to PlaceHolder, but when I click some controls in other UpdatePanels the PlaceHolder in UpdatePanel1 loses all labels.
can you help me to fix this problem ?
Thx a lot my friends,
www.behzadi.net
|
|
|
|
|
hi All,
Please provide any articles with implementation or references on how to implement drag drop and edit with asp.net treeview and save the changes done at client side to database at server side.
any ideas on how to do it are also welcome
thanks in advance
Rama Charan Prasad
"Be happy and Keep smiling.Thats what u want be always.. "
|
|
|
|
|
i created master page with main menu(.NET control) and i added the script manager frist then the updatepanel and then i insert the menu in the updatepanel,but when i navigate the pages the menu still post-backes...
if i but a button it worked ok......
so any ideas?
regrds
|
|
|
|
|
I am not an AJAX expert but I don't think you can navigate from one page to another without postback.AJAX works on the button because it causes postback to the page itself.
|
|
|
|
|
exactly....
the menu is in the master page....so y the menu is redrawan when i navigate.technically i still in the master page
so the palce holder wich contains the navigated page is postback but menu apears that it is also postback
thx
|
|
|
|
|
Hi
I need to get the list of printers installed on the
server (both network and local printers).Using .net WebServer,i can see all the installed printers ,when I run the
application using IE on the server,I cannot get
the list of printers .
Help me.
|
|
|
|
|
hi there
my aspx files are going to read some parameters from a properties.ini file residing in the same directory.
have a couple of queries -
1. how do I avoid reading the properties file on each aspx request? is there a way to store the properties in memories on the server so that they can be used from memory for each request.
2. how do I deny direct access to the properties.ini file from the browser and give access only to the aspx file to read it? Is there any other directory where I can place it and still access it from aspx but not otherwise?
FYI, i'm using asp.net version 1.1
thanks.
-c-s-k
|
|
|
|
|
Can't you store those parameters in web.config instead of the ini files?If you do you don't have anything to wory about as the config file is not accessible from any browser.
|
|
|
|
|
Thanks for your response. I did some research after I posted my query, and it turns out that I have to indeed use an ini file.
I started with web.config, and then to an external config file for my parameters (http://aspalliance.com/705_Create_and_Use_a_Custom_Config_File.all[^]).
but then realized that my paramters are URLs with an ampersand in them. The config files being XML do not allow ampersand unless escaped, but that's not an option for me. I then came across this - http://www.codeproject.com/KB/cs/readwritexmlini.aspx[^] - which allowed me to read INI files in C#.
Anyways, my question 1 I posted earlier is still a concern - this INI is going to be read on every request to the aspx. How does it work if the parameters are put in the web.config?
For my question 2, it looks like IIS doesnt serve .config files but serves .ini files happily. So I placed it under App_GlobalResources. Now my question is - what is the difference between App_GlobalResources and App_LocalResources - I am able to place this ini file under App_LocalResources and still access it from every aspx file.
Thanks!
|
|
|
|
|
View a printable version of this message! Hi,
I'm trying to change an MS Access query definition using ADOX in my ASP.NET 2.0 c# web site.
Here is my function:
<br />
public void ModifyQueryXDateFilter( string strConn, string strQryName, string strSQL)<br />
{<br />
ADOX.Catalog catDB = new ADOX.Catalog();<br />
ADODB.Command cmd = new ADODB.Command();<br />
catDB.ActiveConnection = strConn;<br />
cmd = (ADODB.Command) catDB.Procedures[strQryName].Command;<br />
cmd.CommandText = strSQL;<br />
catDB.Procedures[strQryName].Command = cmd;<br />
catDB = null;<br />
}<br />
the line:
catDB.ActiveConnection = strConn;
doesn't work. I get a typically microsoft error that means every thing except the right thing:
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
Can anyone help with this?
Just Relax And Keep It Simple.
|
|
|
|
|
Hi,
I have an asp:Panel control on my web page. I am using ASP.NET 2.0. When I view source in Internet Explorer and FireFox it is displayed as a div element. When I view source in Opera it is displayed as a table. I don't want a table because it's messing up my layout. What else can I use and what else is recommend?
Brendan
|
|
|
|
|
You can use div instead of asp:panel
|
|
|
|
|
Thanks, that I know I can. It was what I wanted to do first, but I searched Google how to populate a Div with data from SQL Server and could not find any. If you have anything on how to populate a div from the server please let me know.
I tried something like:
<div id="Categories" runat="server"></div>
|
|
|
|
|
You can either put a single text in the InnerText property, or add elements to the Controls collection.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Does a div tag have a controls collection???
Have you got a sample there?
|
|
|
|
|
.NET Enthusiast wrote: Does a div tag have a controls collection?
Yes.
.NET Enthusiast wrote: Have you got a sample there?
Categories.Controls.Add(new LiteralControl("Hello world."));
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
What are you to do? I dont think you can populate a div with data but instead you can populate controls that are in the div.you know what I mean?Let me know in details what you are trying to do so that I can better help you.
|
|
|
|
|
Go and look at www.samarketplace.co.za, look at the categories with their subcategories. Currently, (not online at the moment) I have an asp:Panel and then I populated it (as shown) in the code behond. Ideally I would like to populate a div the same way.
|
|
|
|