|
ronivars wrote: so i need to improve Existing web application and a lot of object created
in my company store in application object that influencing performance
when concurrent users try to request pages
let's say for example data access(DAL) object is store in httpApplication
it's serve only one request at a time if i have 10 users concurrent thay will
angry
I only have a vague idea what you are trying to say here... You have to divide what you write into sentences, or it's practically impossible to decipher.
If each HttpApplication object only serves one request at a time, that means that each worker thread in the application has it's own HttpApplication object. That in turn means that if you store anything in the HttpApplication object, it will only be available from that worker thread.
If you cache DAL objects in the HttpApplication object, they will be local to the worker thread, which is very bad for cached objects. If you have for example ten worker threads, you will have ten copies of the cache in memory. That is bad, but nothing compared to the mess you can get if you update the data in the database and update the cache in the current thread accordingly. Then you have inconsistent data across threads, which will lead to users seeing old data and writing over each others changes.
If you want to share data in the application, you should store it in the HttpApplicationState object instead of in the HttpApplication object. You can use the Lock and Unlock methods of the HttpApplicationState object to make sure that only one thread at a time has access to it when you update values.
---
Year happy = new Year(2007);
|
|
|
|
|
hi Guffa thank for help
Now i Understand how apllication Work in depth
thanks Again
if Somebody wan't to understand how Application Work:
http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/#S9
roni vars
|
|
|
|
|
hi again guffa,
the DAL problem is just for example,
is it true to say every request have one worker thread?
thanks
roni vars
|
|
|
|
|
ronivars wrote: is it true to say every request have one worker thread?
Yes. The worker thread is only unique to the request while the request is handled, though. After the request is handled, the worker thread will be returned to the pool and reused for other requests in the future.
---
Year happy = new Year(2007);
|
|
|
|
|
C# is the code behind lang.
What I want to do is display an image and then have some text describing the image float/display around the image. I used a System.Web.UI.WebControls.Image control on the page. The text and URL for the image will be pulled from a database when the page loads. I have that part all figured out. The question is how do I float the text around (not on top) the image like I can do in MS Word.
I did try to search the articles because I know I am not the first person with this question, so if I missed it, please refer me to it.
Thanks for all your help.
Patrick
|
|
|
|
|
This is a web development question rather than an ASP.NET question, as the solution is in HTML and CSS.
Make the image a floating element, and the text will float around it. Example:
<p><img src="..." style="float:left">The image will be placed at the left side, and this text will float to the right of the image.</p>
---
Year happy = new Year(2007);
|
|
|
|
|
Thanks. The asp part is "How do I get the text from the c# code (which I retrieved from the database) to the html page?" That is what is really confusing me? I tried calling a <%# GetText() %> but that did not work.
Thanks so much for your help.
patrick
|
|
|
|
|
Put a Literal control in the page and put the text in it's Text property:
<asp:Literal id="objText" runat="server" /><br />
<br />
objText.Text = "string from the database";
---
Year happy = new Year(2007);
|
|
|
|
|
Guffa,
Thank you very much!!!
Patrick
|
|
|
|
|
How can i filter tags like " ,,," from the html text.Are there any filters that filters these kind of tags when html text document is passed to that filter.
|
|
|
|
|
Use the "Ignore HTML" option when you are posting markup code.
---
Year happy = new Year(2007);
|
|
|
|
|
Sir
Where should I write my SIUD commands in my Code-behind Page or there should be a Class file named with our aspx file and in this file I should write the SIUD codes? What is the universal method for a proffessionals?
S.I.U.D means= Select, Insert, Update, Delete
Durgesh Kumar Mishra
|
|
|
|
|
SIUD
In general creating connections , issuing select, insert, update, and delete commands, and so on should be located in the Data Access Layer [^](DAL) class. your presentation layer (aspx) should not contain any references to such data access code, but should instead make calls into the DAL for any and all data requests
|
|
|
|
|
You're describing a 'no tier' methodology. Your data access should be in a seperate layer, which means not using the new MS stuff that forces you to write SQL in the aspx or the code behind.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi,
I have made a treeview, wich expand, when I remove the code:
root.NavigateUrl = "Default.aspx?id=" + ParentNode[loop, 0];
BUT I have to know, what Id (which node in the treeview the user select), to give the right input from the database.
I have stroggeld with this issue in many days now, but I still don't know what I shall do, so that when I redirect to Default, that it expand the treeview on that node, the user selected. Please can anybody help me?
My Code:
<br />
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using System.Data.OleDb;<br />
<br />
public partial class _Default : System.Web.UI.Page <br />
{<br />
private OleDbConnection connection = null;<br />
public OleDbCommand command = null;<br />
public string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\Inetpub\\wwwroot\\Test\\Menu3\\menu.mdb;";<br />
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!IsPostBack)<br />
{<br />
fill_Tree();<br />
}<br />
}<br />
<br />
void fill_Tree()<br />
{<br />
<br />
connection = new OleDbConnection(connectionString); <br />
connection.Open();<br />
<br />
<br />
command = new OleDbCommand();<br />
command.Connection = connection;<br />
<br />
DataTable myDataTable = new DataTable();<br />
myDataTable.Columns.Add(new DataColumn("CategoryID", Type.GetType("System.String")));<br />
myDataTable.Columns.Add(new DataColumn("ParentCategoryID", Type.GetType("System.String")));<br />
myDataTable.Columns.Add(new DataColumn("CategoryName", Type.GetType("System.String")));<br />
command.CommandText = "SELECT * FROM CATEGORIES WHERE ParentCategoryID = 0";<br />
<br />
command.Parameters.Clear();<br />
<br />
<br />
OleDbDataReader myReader = command.ExecuteReader();<br />
<br />
<br />
command.Dispose();<br />
<br />
<br />
<br />
string[,] ParentNode = new string[100, 2];<br />
<br />
<br />
<br />
int count = 0;<br />
<br />
<br />
while (myReader.Read())<br />
{<br />
ParentNode[count, 0] = myReader.GetValue(myReader.GetOrdinal("CategoryID")).ToString();<br />
ParentNode[count++, 1] = myReader.GetValue(myReader.GetOrdinal("CategoryName")).ToString();<br />
}<br />
<br />
<br />
<br />
<br />
for (int loop = 0; loop < count; loop++)<br />
{<br />
<br />
TreeNode root = new TreeNode();<br />
root.Text = ParentNode[loop, 1];<br />
root.PopulateOnDemand = false;<br />
root.SelectAction = TreeNodeSelectAction.SelectExpand;<br />
<br />
<br />
<br />
root.NavigateUrl = "Default.aspx?id=" + ParentNode[loop, 0];<br />
<br />
myReader.Close();<br />
<br />
<br />
OleDbCommand Module_SqlCmd = new OleDbCommand("Select * from CATEGORIES where ParentCategoryID =" + ParentNode[loop, 0], connection);<br />
<br />
OleDbDataReader Module_Sdr = Module_SqlCmd.ExecuteReader();<br />
<br />
while (Module_Sdr.Read())<br />
{<br />
<br />
TreeNode child = new TreeNode();<br />
<br />
child.Text = Module_Sdr.GetValue(Module_Sdr.GetOrdinal("CategoryName")).ToString();<br />
<br />
child.Target = "_blank";<br />
<br />
child.NavigateUrl = "your_page_Url.aspx";<br />
<br />
root.ChildNodes.Add(child);<br />
}<br />
<br />
Module_Sdr.Close();<br />
<br />
TreeView1.Nodes.Add(root);<br />
<br />
}<br />
<br />
<br />
TreeView1.CollapseAll();<br />
connection.Close();<br />
<br />
}<br />
<br />
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)<br />
{<br />
TreeView1.CollapseAll();<br />
ExpandNodes(TreeView1.SelectedNode.ValuePath);<br />
}<br />
<br />
private void ExpandNodes(string valuepath)<br />
{<br />
string[] tmp = valuepath.Split('/');<br />
string tmpValuePath = string.Empty;<br />
foreach (string s in tmp)<br />
{<br />
tmpValuePath += s;<br />
TreeView1.FindNode(tmpValuePath).Expand();<br />
tmpValuePath += "/";<br />
<br />
}<br />
}<br />
}<br />
Kind regards,
simsen
|
|
|
|
|
Try this..............
When u click on node. Get the selected noe and save in session variable.
when page is postback then check in session is not null then expand the selected node which store in session variable. otherwise do nothing.
if u'r problem is different plz clerify here.
Parwej Back...............DON of Developer.......
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
Hi Parwej,
Please can you give me som example code. I am a newbee, so I am a little lost in what you write to me
Kind regards,
simsen
|
|
|
|
|
Plz find this url............
http://www.15seconds.com/issue/041117.htm
Parwej Back...............DON of Developer.......
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
Hi Parwej
I am sorry, but I cannot see, what this helps me? I tried to use that code instead of my own. There is severel things here...... It don't expand/collapse when I click on the text (I don't want the arrows or other things - only text from my database).
I want it so, if I click on the text, it shall redirect to the same page, but with the id for the specific entry, I clicked on in the url, and it shall expand the tree again (after redirecting) so the same id is selected.
Like this:
Home
Products
...Cars
...Phones
...Laptops
Company
...Who we are
...Our location
Now when I load the site, it should look like this:
Home
Products
Company
When I click on Products it should redirect to the same site where in the url now instead of http://wwww.mypage.com/Default.aspx now sais http://www.mypage.com/Default.aspx?id=2 AND the menu should look like this:
Home
Products
...Cars
...Phones
...Laptops
Company
and so on.... Whith my first code, I could do everything .... only it don't expand the menu where I clicked.....
Can you please help me with this?
Kind regards,
simsen
|
|
|
|
|
I am trying to run asp.net applications on Windows XP home edition but I am unable to run the applications where it is throwing me an error message without opening the application.
I have installed Cassini but still its no use.
Message is:
---------------------------
Microsoft Development Environment
---------------------------
Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services.
-------------------------
Can you please help me out.
Thanks.
Amar.
|
|
|
|
|
This problems rise when u r install two version of framework....
Plz write this command. Follow the steps.........
(1)Go commnad prompt.......
(2)C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis -i
Parwej Back...............DON of Developer.......
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
I tried the above solution but its still the same error.
|
|
|
|
|
plz view my blog........
http://gparwez.blogspot.com
Parwej Back...............DON of Developer.......
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
Unfortunately I am having Windows XP Home edition. When I went to Control Panel/Administrative tools - there is no IIS in there. What next....
|
|
|
|
|
XP Home is not for developers. You will not get IIS from XP Home OS. We can install IIS from some shortcut ways by changing registry and extracting some dl files from 2000 server and putting it in Root directory. But it will give you errors only. You will not get SMTP server also. Please install XP Professional.
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
|
|
|
|