|
hi
I have created one method createdropdown()in that i had create one dynamic dropdownlist and in selectindexchange of that dropdownlist i had created another dynamic dropdownlist and again selectedindexchange of the second dropdown .
but when i run this code it will call first selectedindexchange when i select the dropdownvalue but it want call second selectedindexchange.
i had done autopostBack=true for both the dropdownlist.
Please Help It is some urgent Task that i have to complet.
in the below ddl_SelectedIndexChanged() is call but ddl2____SelectedIndexChanged is not fired.....?
<br />
private void CreateDropDownBoxes()<br />
{<br />
for (int counter = 0; counter <= NumberOfControls; counter++)<br />
{<br />
DropDownList ddl = new DropDownList(); <br />
ddl.ID = "DropDownList_ID" + (counter + 1).ToString(); <br />
<br />
ddl.AutoPostBack = true;<br />
ddl.AppendDataBoundItems = true;<br />
ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);<br />
DataTable dt = new DataTable();<br />
dt = getdata_workspace();<br />
ddl.DataSource = dt;<br />
ddl.DataTextField = "displayedname";<br />
ddl.DataValueField = "id"; <br />
ddl.DataBind(); <br />
<br />
phDropDownLists.Controls.Add(ddl); <br />
phDropDownLists.Controls.Add(new LiteralControl("<br><br><br>")); <br />
}<br />
}<br />
public void ddl_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
int n = this.NumberOfControls;<br />
for (int i = 0; i < n; i++)<br />
{<br />
SqlConnection conn = new SqlConnection(connStr);<br />
string boxName = "DropDownList_ID" + (i + 1).ToString();<br />
DropDownList ddl2_ = phDropDownLists.FindControl(boxName) as DropDownList;<br />
<br />
DropDownList ddl2___ = new DropDownList(); <br />
ddl2___.ID = "DropDownList__" + (i + 1).ToString();<br />
ddl2___.AutoPostBack = true;<br />
ddl2___.AppendDataBoundItems = true;<br />
ddl2___.EnableViewState = true;<br />
<br />
SqlCommand cmd = new SqlCommand("select * from unit where workspaceid='" + ddl2_.SelectedValue + "'", conn);<br />
conn.Open();<br />
SqlDataReader dr = cmd.ExecuteReader();<br />
while (dr.Read())<br />
{<br />
ddl2___.Items.Add(dr.GetString(2)); <br />
}<br />
<br />
ddl2___.SelectedIndexChanged += new EventHandler(ddl2____SelectedIndexChanged);<br />
ddl2___.DataTextField = "displayedname";<br />
ddl2___.DataValueField = "id";<br />
phTextBoxes.Controls.Add(ddl2___);<br />
phTextBoxes.Controls.Add(new LiteralControl("<br><br><br>"));<br />
<br />
}<br />
<br />
}<br />
void ddl2____SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
int n = this.NumberOfControls; <br />
for (int i = 0; i < n; i++)<br />
{<br />
SqlConnection conn = new SqlConnection(connStr);<br />
string boxName = "DropDownList__" + (i + 1).ToString(); <br />
DropDownList ddl2_ = phTextBoxes.FindControl(boxName) as DropDownList;<br />
DropDownList ddl2___ = new DropDownList();<br />
ddl2___.SelectedIndexChanged += new EventHandler(ddl2____SelectedIndexChanged);<br />
ddl2_.ToolTip = "ddl2";<br />
SqlCommand cmd = new SqlCommand("select * from unitoperation where workspaceid='" + ddl2_.SelectedValue + "'", conn);<br />
conn.Open();<br />
SqlDataReader dr = cmd.ExecuteReader();<br />
while (dr.Read())<br />
{<br />
ddl2___.Items.Add(dr.GetString(3));<br />
}<br />
phdropdown3.Controls.Add(ddl2___); <br />
}<br />
} <br />
<br />
<code><br />
Please Help ...Help...
|
|
|
|
|
When do you create them ? Early enough that they are in the control tree when viewstate is restored ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello,
Does anyone know how to check whether a folder path( not file path ) exists or not? c# with asp.net
Please let me know ASAP.
Nana
|
|
|
|
|
Got it. System.IO.Directory.Exists
Nana
|
|
|
|
|
System.IO.Directory.Exists("strPathToTest")
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Directory.Exists(@"C:/Windows/")
in System.IO
|
|
|
|
|
Hello,I'm a beginner to ASP.NET. I found a problem on creating a session with how I do it in ASP last time. I'm using it for my webpage to save only 3 information using session which is 1)Username, 2)Gender and 3)UserLevel.
Anyone can give me the code that we can used is ASP.NET ? The following are what I did last time in my ASP page.I'm using VB code as backend and connecting with MS SQL2000.
Session("UserName")= objrs("Login_name")
Session("Gender")= objrs("Gender")
Session("UserLevel")= objrs("user_level")
Hope someone can give me some solution here for my ASP.NET problem. Thank you for reading~!
Regards
Drex
|
|
|
|
|
dear Drex,
i think you have used some recordset to show the user's details.
In Asp.net you can use any controls to show the user details.
you can use sqldatareader to read the table.
then use the same session concept here
All The Best
Sathesh Pandian
|
|
|
|
|
Yes,I use the recordset. I use it to check the user login with correct password. Its for validation purpose and I have done it.
But now I don't know how to create a session in my page. I need to have 3 session which is 1)Username 2)Gender and 3)Userlevel.
Anyone can give me a solution how to create those Session in ASP.NET?
Thanks~!
|
|
|
|
|
it s the same thing you have done in the asp.
session("UserName")=user_name
user_name is a variable.
user_name can be retrieved from sql database
All The Best
Sathesh Pandian
|
|
|
|
|
Sorry,I still unable to use the session as normal way in ASP. Anyone can tell me whats the problem actually?
This is the code I use to create the session on MemberPage1:
//The textbox1 is the username. I create it as a session to pass to other page.
Session("Username") = TextBox1.Text
This is the code I use on another page MemberPage2:
Dim Username As String
Label3.Text = "Welcome " & Session("Username") & ""
//I want to test it with displaying a welcome follow by username.
But the above code doesn't work. Anyone can tell me the error or any other solution?
Thank you~!
|
|
|
|
|
drexler_kk wrote: Anyone can give me a solution how to create those Session in ASP.NET?
Storage location
InProc - session kept as live objects in web server (aspnet_wp.exe). Use "cookieless" configuration in web.config to "munge" the sessionId onto the URL (solves cookie/domain/path RFC problems too!)
StateServer - session serialized and stored in memory in a separate process (aspnet_state.exe). State Server can run on another machine
SQLServer - session serialized and stored in SQL server
Performance
InProc - Fastest, but the more session data, the more memory is consumed on the web server, and that can affect performance.
StateServer - When storing data of basic types (e.g. string, integer, etc), in one test environment it's 15% slower than InProc. However, the cost of serialization/deserialization can affect performance if you're storing lots of objects. You have to do performance testing for your own scenario.
SQLServer - When storing data of basic types (e.g. string, integer, etc), in one test environment it's 25% slower than InProc. Same warning about serialization as in StateServer.
Regards,
Satips.
|
|
|
|
|
Hi All,
Can we open a file in a loacation outside the PhysicalApplicationPath.
And set the path to a hyperlinks NavigateUrl property?
Please Help
Biju Sam
|
|
|
|
|
Dear biju,
its not possible in web applications. you have to store/upload the files in
some locations and you can navigate the links.
otherwise it may show some security errors when you are implementing this in
client side.
all the best.
Sathesh Pandian
|
|
|
|
|
You have to store the PDF files in the Database and try to Fetch it.
Regards,
Satips.
|
|
|
|
|
If i put the path like C;/........
it will not open it.
Biju S
|
|
|
|
|
dear biju,
Are you using C# ?
In C# you have use C:\\folder\\file
In vb.net you can easily mention like this C:\folder\file
All The Best
Sathesh Pandian
|
|
|
|
|
You can Use it to get the data from Drive C.
Use the path C:\\folder\\file in your code and try to fetch the data.
With Regards,
Sakthi
|
|
|
|
|
I'm using the correct syntaxes. for the path.
but the hyperlink will not open the file unless you give ~\\folder\\file
i need to emiminate this.
Biju S
|
|
|
|
|
Hi All,
The requirement is to create factory class that implements a set of cross-cutting aspect classes and provides configuration to create user defined implementations for them at runtime. The user defined assemblies implement the Command pattern, and are invoked in the order they are configured. This requires using Enterprise library for handling configuration data in an external configuration file.
The factory is a singleton class. It references each aspect by an interface. The factory also defines wrapper class to invoke aspect method calls, and load the assemblies on demand.
Please Provide the necessary code and material.
Thanks,
Ramesh Bhojan
|
|
|
|
|
We are here to Help you only,not to do your Work.
So for what you have done for the above stated Application.
What error it says.?
Post your doudt we can help you.
Regards,
Satips.
|
|
|
|
|
Dear Satips,
I have no prior experience on the topic of Aspect factory and Class Factory.
I jus wanted to check if someone had done some sort of job related to this earlier, which could be helpful to me....
I am not asking you to do my job.I just require some supportive documents.
It would be helpful if ppl could share a few docs or code using factory class and aspect factories, which they had worked earlier on.
Thanks,
Ramesh
|
|
|
|
|
Hi Ramesh,
I have not worked in Aspect Factory.
But i have got someuseful links related to that from my friend.Get it[^]
Hope this will help you in your application.
Regards,
Satips.
|
|
|
|
|
I recommend buying the 'design patterns' book, it will cover these things for you.
Or google it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i want to create a forum like code project in asp.net.how can i do that?what are the basics?shud we use datagrid in this application?pls help.
"know ur knowledge"
|
|
|
|