|
http://www.asp.net/learn/ajax-videos/[^]
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
Hi All,
I am using ASP.NET 2.0 (C#). I have a datatable where all the values are there now I need to write a recursive function but I am not getting the proper values. My datatable has the following data:
CID Desc PID
A T1 NULL
B T2 A
C T3 B
D T4 A
Please help me with this...
Thanks in advance...
|
|
|
|
|
ASP.NET 2.0 wrote: now I need to write a recursive function
Recursive function for what ?
|
|
|
|
|
Thanks for the reply. I have to write the recursive function to show the output as treeview.
|
|
|
|
|
ASP.NET 2.0 wrote: need to write a recursive function but I am not getting the proper values.
What are you trying to do? Where is your code?
Paul Marfleet
|
|
|
|
|
Thanks for the reply. I have to write the recursive function to show the output as treeview.
I have to generate the script based on the datatable rows. My normal function works fine if it has only one level but now in my datatable there can be more levels and for this I need to write recursive function. Following is the code:
private void FillValues(DataTable dtFinal)
{
int intChildRowCnt = 0;
StringBuilder strDBScript = new StringBuilder("");
strDBScript.Append("<script language='javascript' type='text/javascript'>");
// Create wsGrid Instance
strDBScript.Append("var m_wsGridCtrl = new jsTreeGridCtrl();");
// Param1: width
// Param2: OnMouseOver Color
//strDBScript += "m_wsGridCtrl.initializeDocument(1000, '#FF9999');";
strDBScript.Append("m_wsGridCtrl.initializeDocument(1000, '#8A9FFF');");
// Titles
// Param1: Text
// Param2: Width
// DataTable dtFinal = GetDataTable();
Int32 intColCnt;
if (dtFinal.Rows.Count > 0)
{
for (intColCnt = 0; intColCnt <= dtFinal.Columns.Count - 1; intColCnt++)
{
if (intColCnt == 0)
{
strDBScript.Append("m_wsGridCtrl.InsTab('Show All', '30');");
}
else if (intColCnt == 2)
{
}
else if (intColCnt == 1)
{
strDBScript.Append("m_wsGridCtrl.InsTab('" + dtFinal.Columns[intColCnt].ColumnName + "', '50');");
}
else
{
strDBScript.Append("m_wsGridCtrl.InsTab('" + dtFinal.Columns[intColCnt].ColumnName + "', '20');");
}
}
DataRow[] foundParent;
DataRow[] foundChild;
foundParent = dtFinal.Select("PresentationParentSpecElementID Is null");
if (foundParent.GetUpperBound(0) > 0)
{
for (Int32 intRowCnt = 0; intRowCnt <= foundParent.GetUpperBound(0); intRowCnt++)
{
foundChild = dtFinal.Select("PresentationParentSpecElementID=" + foundParent[intRowCnt]["SpecElementID"]);
if (foundChild.GetUpperBound(0) > 0)
{
strDBScript.Append("var iItem" + intRowCnt + "=");
}
strDBScript.Append("m_wsGridCtrl.InsItem(null, '");
for (intColCnt = 0; intColCnt <= dtFinal.Columns.Count - 1; intColCnt++)
{
if (intColCnt == 0 || intColCnt == 2)
{
}
else
{
strDBScript.Append(foundParent[intRowCnt][intColCnt] + ";");
}
}
strDBScript.Append("');");
for (intChildRowCnt = 0; intChildRowCnt <= foundChild.GetUpperBound(0) - 1; intChildRowCnt++)
{
strDBScript.Append("m_wsGridCtrl.InsItem(iItem" + intRowCnt + ",'");
for (intColCnt = 0; intColCnt <= dtFinal.Columns.Count - 1; intColCnt++)
{
if (intColCnt == 0 || intColCnt == 2)
{
}
else
{
strDBScript.Append(foundChild[intChildRowCnt][intColCnt] + ";"); }
}
strDBScript.Append("');");
}
}
}
else
{
foreach (DataRow row in dtFinal.Rows)
{
strDBScript.Append("m_wsGridCtrl.InsItem(null, '");
for (intColCnt = 0; intColCnt <= dtFinal.Columns.Count - 1; intColCnt++)
{
if (intColCnt == 0 || intColCnt == 2)
{
}
else
{
strDBScript.Append(row[intColCnt] + ";");
}
}
strDBScript.Append("');");
}
}
strDBScript.Append("m_wsGridCtrl.GenerateCode();");
strDBScript.Append("m_wsGridCtrl.RecudeAllTree();");
strDBScript.Append("</script>");
ClientScript.RegisterClientScriptBlock(this.GetType(), "onload", strDBScript.ToString()); }
}
Now I need to convert this in recursive function..
Please help me...
Thanks again...
|
|
|
|
|
You could consider using the SQLXML managed classes to return the results of your query as an XML document. I don't know what treeview control you are using (some 3rd party / bespoke component) but if you use the TreeView control in ASP.NET 2.0 then you can bind the control to an XML datasource. You then don't have the hassle of writing your own population routine.
Paul Marfleet
|
|
|
|
|
Thanks for the reply. I have to use Treeview only as I have to show the data as TreeGird (TreeView Inside GridView) and so I am generating script for the same which builds the TreeGrid control.
Please help me with this...
Thanka again....
|
|
|
|
|
How to pass url of upload control in to session varibles.
when we are uploading a image before it was upload (i.e after browsing) that image displayed in another page.
Please give sufficient websites
priority: very high
|
|
|
|
|
kishoregani wrote: priority: very high
If your question is of such high priority, why are you not paying for assistance instead of coming to a site where people offer their help for free?
Anyway, you haven't expressed the problem intelligibly so I don't understand what you are trying to do.
Paul Marfleet
|
|
|
|
|
kishoregani wrote: when we are uploading a image before it was upload (i.e after browsing) that image displayed in another page
You can take the file name to session easily like following code
Session["FileName"] = FileUpload1.PostedFile.FileName
But this won't help you to show the image on next page until it is not uploaded. This filename gives client path for image. This can't be loaded using a server side scripting.
Are you looking for an image preview ? Then try using some javascript and show the image.
|
|
|
|
|
if exists(select CombinationId from tblItemsIdComposition where Id = @itemid and SubId = @subitemid and SSubId = @ssubitemid )
begin
select @combinationid = CombinationId from tblItemsIdComposition where Id = @itemid and SubId = @subitemid and SSubId = @ssubitemid
end
can i improve it a little bit?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
You should ask questions like this in the SQL forum - it has nothing to do with ASP.NET.
Paul Marfleet
|
|
|
|
|
Hi Sonia,
Here u throw same query twice, which is not necessary.. instead u can write like this:
select @combinationid = CombinationId from tblItemsIdComposition where Id = @itemid and SubId = @subitemid and SSubId = @ssubitemid
-- @combinationid is null implicitly means that record does not exist!!
if @combinationid is null
begin
select 'not found'
end
else
begin
select 'found'
end
Hope this helps
Mitesh
|
|
|
|
|
what about
@combinationid = isnull(select CombinationId from tblItemsIdComposition where Id = @itemid and SubId = @subitemid and SSubId = @ssubitemid,0)
Hope its correct!!!
Paras Kaneriya The difference between genius and stupidity is that genius has its limits.
|
|
|
|
|
hi all,
i have to validate a textbox that which allow the user to type other than special charecters.
Thanks And Regards,
GuruKiran.
|
|
|
|
|
Write a javascript function validating..
|
|
|
|
|
I need regular expression to validate i writeen method but i hav to pass regular expression.
Thanks And Regards,
Guru
|
|
|
|
|
You could use a RegularExpressionValidatorControl and link it to your text box to constrain its input.
What characters do you want to allow/exclude? By way of example, the following regular expression will match if a string contains only alphanumeric characters, apostrophes, full stops and spaces.
^[a-zA-Z0-9'.\s]*$
Paul Marfleet
|
|
|
|
|
thanks I am waiting for this answer
|
|
|
|
|
That's OK. It's probably a good idea if you learned how to regular expressions work if you need to use them in your .NET code. I find the Expresso[^] tool useful whenever I am working with regular expressions.
Paul Marfleet
|
|
|
|
|
hi all ,
i'm trying to use the dotmsn component in order to be able to connect to MSN server and get the msn contacts.
the component seems to run in separate thread from asp.net page thread.
so i have a form with 2 textboxes "one for the email and the other one for the password" and a button.
pressing the button causes the form to post back and click handler to excute ..
when i call the connect method of the messenger class in DotMSN component another thread start for connecting to MSN server.
but the asp.net page or thread does not wait for the events of this messenger class -" events like connection_established, connection_error"-
the page is rendered with no actions taken ... without waiting for the other thread to finish excution.
i need a way for asp.net page to wait for this thread of the component to finish excution either by firing the connection established event or any other error event ...
Thanks in advance , i really need help about that.
Davids Maguire
|
|
|
|
|
On my website i used to run the html pages this time i created asp page and uploaded on the site. The asp page tells the browser to download the file, instead of showing it. If i run the same asp page on the my local IIS, it runs correctly.
Can anyone tell me What could be the problem area?
Thanks and regards.
|
|
|
|
|
The site is not configured to serve ASP, obviously.
Do you mean ASP, or ASP.NET ? They are two different things. Ths is the ASP.NET forum. If it's ASP.NET, then the .NET framework needs to be installed on the server.
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 )
|
|
|
|
|
Thanks Christian for your reply.
This is for classic ASP page only. Could you please guide me about what kind of configuration needed on the server to serve ASP page. I mean where this value to be set on the server so that from my account i can execute ASP page.
-- modified at 2:12 Friday 5th October, 2007
|
|
|
|