|
hai.
currently i m using asp.net with c# (.net 2005, framework 2.0)
switch (dropdownlist1.SelectedItem.Value)
{
case "1":
Process1("Tab1", "Assessment1");
break;
}
switch (dropdownlist1.SelectedItem.Value)
{
case "1":
Process2("Tab1", "Assessment1");
break;
}
switch (dropdownlist1.SelectedItem.Value)
{
case "1":
Process3("Tab1", "Assessment1");
break;
}
There are three switch cases as like above. INSTEAD OF THE ABOVE BLOCKS i thought to process as....
protected void Process_Record(string parameter_values)
{
switch (dropdownlist1.SelectedItem.Value)
{
case "1":
parameter_values("Tab1", "Assessment1");
break;
}
}
so that if this Process_Record function is process with appropriate parameter_values the switch can be processed. but i m getting the error 'parameter_values' is a 'variable' but is used like a 'method'
how to overcome it... help me plz. - KARAN
|
|
|
|
|
Looks to me like you don't really know much C#. parameter_values is indeed a variable, you passed it in. Your code is therefore wrong. You can't name a method the same as a variable, the compiler plain won't know what to do. I don't understand the core question - you had three switch statements in a row ? Why on earth would you do that ? Either call your three methods in the one switch, or write a method that calls all three, if this is appropriate.
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
Hi!
As mentioned by Christian, your intent is not clear, however you should look at delegates / Multicast delegates to try and solve your problem.
Maybe if you provided a better example of your intention and hurdles are, it might make it easier to provide assistance.
Hope this helps
www.fuzzelogicSolutions.com
modified on Saturday, November 8, 2008 8:09 AM
|
|
|
|
|
i sorry i have forgoten that i want to show images like matris.4 calumns 10 lines.i wish i could explain aims.
|
|
|
|
|
1 - the site has an edit post button, so you don't need to double post
2 - the easiest way to do this is with a repeater, and a data source containing URLs to your images. A repeater gives you lots of control in writing code to generate a table with the number of rows and columns you desire, where each cell contains the same data, that is, where your data source doesn't create columns for you automatically.
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
i m new in ASP.net and it like a huge ocean really .is there any sample videos or sample codes about this subject?Sorry for sending same subject two times
|
|
|
|
|
You said you were not new below?
A repeater just emits html, according to your template. I'd write a template that calls code behind and uses a counter to work out when to emit a tr to start a new row. I am sure that samples exist, did you look for articles on repeaters on this site ?
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
|
OK, so as I've told you to do it using repeaters, reading up on them is probably your next step, right ?
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
Hi to everyone.i want to do like this site:
i have 4 or 5 catgegories in my main page.when people click one of this cathegory i want to show images about this cathegory.i want to show images paged.i mean in each of my cathegory can be 100 images.How i want to do like this site?i want to use database in this project.i m not so new in asp.net.i had tried to make site but i was tired of cause i was trying it by myself.
|
|
|
|
|
See above.
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
Christian Graus wrote: See above.
Gee, you got downvoted. I guess it is because you are so unhelpful.
Jon
Smith & Wesson: The original point and click interface
|
|
|
|
|
I have txt file which save n numbers of records.
e.g http://134.17.0.1/WebAPP/Internet/E/Y/U/try & g/HomePage.htm" />
when i convert txt file into xml file create error.
xml file can not support & operator. how resolved this probleam.
|
|
|
|
|
|
Hi..
I'm using master page and added script manager in master page and in pages m adding scriptmanagerproxy. Now while m using updatepanel in pages then asynchronous postback is working in firefox but its not working in ie7.
please let me know what could be the reason.
thanx..
krishna veer singh
|
|
|
|
|
Hi all,
My issue is that I want to add a new group of server controls after clicking a A button, a the remove the last one after clicking B button. Could I do it with javascript and How can I validate a new group of controls after adding?
If there is no ways with javascript, please give me any other suggestions to solve my problem.
Please give me some ideas or related topics if existing.
Thanks for your supports
Banana
|
|
|
|
|
Yes you can create using javascript, but you will be responsible to maintain there viewstate during the postbacks
Have a look to this
http://aspdotnetcodebook.blogspot.com/2008/03/how-to-create-textbox-dynamically-using.html[^]
Performing validation that should be at server side ...
using javascript is complex to write but it increased the performance as reduced the hits to server.
Instead of javascript you can use AJAX or simple postbacks to add controls dynamically at server side. this way is very simple to implement
but will need to hit server for adding the controls
So all think depend on you Just google you will get n number of examples for each one
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hi All,
I am new to .NET.
The application I am working with consists of a webpage which has fileupload control , which reads data from the excel file and store it to the oracle database table.
All the successfully read records will move from dataset to one successtable and all other records move to the badrecordstable.
All this part is working fine.
Since the application is multiuser based, I want to make sure that only one copy of the file is processed (though multiple users upload the same file),so that data in the table is not duplicated.
Please guide me how to achieve the singleton.
thanks,
sreelu
|
|
|
|
|
I have a simple progress bar with percentcomplete property. There is a method in a different class that I am calling in my button's click event to process files.
How can I associate the progress bar with that method that processes files?
Thanks for your help.
|
|
|
|
|
First of all, this is not the correct place to write progressbar related question. Well, I think your question will be better to ask in Windows forum.
Well, I think you need to create a new thread to invoke the function. You create an event within the class which have the function.
Now you raiseevent while running the function.
Now from the caller Invoke the function from the thread. Before doing this add an event handler to the code which will be called whenever an event is raised.
Thus you can handle the event and show the progress bar.
You can also make use of EventArgs and define a custom class of yours which will be sending the percentage complete value to the eventhandler.
Abhishek Sur
|
|
|
|
|
Hi
i have two dropdownlist.i bind somthing to first dropdownlist from database.I want when I select an item from dropdownlist1 see some item in dropdownlist2 .but when i select item from dropdownlist1 ,I give this error.
i wrote this code but give error :
error: invalid attempt to call FeildCount when reader is cloused
for binding item to dropdownlist1 i wrote this code in page load:
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "dbo.StoredProcedure19";
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
DropDownList1.DataSource = dr;
DropDownList1.DataTextField = "category_name";
DropDownList2.DataValueField = "category_id";
DropDownList1.DataBind();
con.Close();
dr.Close();
}
in select index change of dropdownlist1
protected void drse(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(connectionstring);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "dbo.StoredProcedure21";
cmd.Parameters.AddWithValue("@category_id", DropDownList1.SelectedItem.Value.ToString());
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
DropDownList2.DataSource = dr;
DropDownList2.DataTextField = "type";
DropDownList2.DataValueField = "id_type";
DropDownList1.DataBind();
con.Close();
dr.Close();
}
}
<asp:dropdownlist id="DropDownList1" runat="server" meta:resourcekey="DropDownList1Resource1" datavaluefield="category_id" datatextfield="category_name" autopostback="True" __designer:wfdid="w10" onselectedindexchanged="drse" xmlns:__designer="#unknown" xmlns:meta="#unknown" xmlns:asp="#unknown">
<asp:dropdownlist id="DropDownList2" runat="server" meta:resourcekey="DropDownList2Resource1" datavaluefield="id_type" datatextfield="type" __designer:wfdid="w12"> </asp:dropdownlist></asp:dropdownlist>
|
|
|
|
|
Can you try below given way to execute reader :
.ExecuteReader(CommandBehavior.CloseConne ction)
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
I try your code,but gave that error again
|
|
|
|
|
Could you try with Data table(Dataset).
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
how? can you explain me more?
|
|
|
|