|
actually my requirement is
I will have multiple datagrids on a page. Each data grid will be the same in structure, but seperate from the others due to user requirements of collabsibility, totalling, etc. Now the database will determine how many datagrids I will need to display.
|
|
|
|
|
hi,
i h a class a.aspx.cs which is derive from another class b.cs and a.spx also h a materpage M.aspx which mean it also inherite M.aspx.cs
now the problem is that when i call this page it is being loaded towice without being postback .i second time page load the Post back is still false
due to which gridview column get twice as i m declaring them dynamically but i h solved this problem using Clear() Method .
what might be the reason can some one help me in this regard .
is using Master page and also deriving from basic page causing the problem
Thnx in advance
|
|
|
|
|
Hi there,
I doubt that what you said here is not the code that causes the error, one of the reasons is that the Master page normally does not end with the .aspx extension. Could you post your real code?
|
|
|
|
|
Hi
I want to bind a tree view to a collection object.
I bind the tree view's datasource in the code behind. how do i bind the data items.
I try doing it but i get this error :
System.InvalidOperationException: HierarchicalDataBoundControl only accepts data sources that implement IHierarchicalDataSource or IHierarchicalEnumerable.
I dont have any problem when i bind the collection to a datagrid.
Any help appreciated.
thanks
Jo
|
|
|
|
|
The DataGrid control inherits from the base class BaseDataList which simply requires that the datasource is an object implementing the IEnumerable or IListSource . Meanwhile, the TreeView control (and the Menu control) inherits from the HierarchicalDataBoundControl which only accepts the datasource implementing the IHierarchicalDataSource [^] or IHierarchicalEnumerable [^] interface like you're seeing. For example, in the .net framework the abstract class HierarchicalDataSourceControl implements IHierarchicalDataSource and has two child derived classes SiteMapDataSource and XmlDataSource , and the SiteMapNodeCollection is an example of implementing the IHierarchicalEnumerable inferface. In your case, your custom class needs to satisfy this requirement if you want to bind it to the TreeView control, otherwise you need to manually create the child node collection of the TreeView control.
|
|
|
|
|
Hi All
I am new to developing ASP code behind (VB) via Microsoft Visual Studio .NET 2003, is anyone kind enough to point me in the right direction to connect to MSDE 2000?
I have managed to make connections to a MSDE2000 SQL dbase as console and VB but am struggling to get connected as a webform.
I have searched the web for examples but this is obviously so simple that there are no examples or comments explaining how to do this!
Here is my test code...
Dim sqlconn As New SqlClient.SqlConnection
sqlconn.ConnectionString = "Integrated Security=True;" & _
"Data Source=LocalHost;Initial Catalog=Test;"
sqlconn.Open()
Dim sqlComm As New SqlClient.SqlCommand("SELECT * FROM " & _
"tblDocuments", sqlconn)
Dim sqlReader As SqlClient.SqlDataReader
sqlReader = sqlComm.ExecuteReader
DataGrid1.DataSource() = sqlReader
DataGrid1.DataBind()
When I run the app I get...
SQL Server does not exist or access denied.
Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or
access denied.
Source Error:
Line 119: sqlconn.ConnectionString = "Integrated Security=True;" & _
Line 120: "Data Source=LocalHost;Initial Catalog=Test;"
Line 121: sqlconn.Open()
Line 122:
Line 123: Dim sqlComm As New SqlClient.SqlCommand("SELECT * FROM " & _
The database is OK because I can connect to it in 'Server Explorer' within VS Studio and view all the data.
Can someone outline each step required? as I am obviously mising something really silly.
Thanks
|
|
|
|
|
Taterface wrote: Line 119: sqlconn.ConnectionString = "Integrated Security=True;" & _
The connection string must have the sql instance name .
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
Hello,
Using a LinkButton how can I ReLoad or Navigate to a different page in an IFRAME.
Thank you for the help.
RB
|
|
|
|
|
What you might need to do is to write a simple client side script block to get reference to the iframe[^], then set the src property to another page. You can attach this block to the LinkButton using the OnClientClick if you are using the ASP.NET 2.0 or the Attributes collection if you are using the version 1.x.
|
|
|
|
|
Thanks for the tip. You got my wheels spinning and I figured it out.
Thanks again.
RB;P
|
|
|
|
|
Ok so I have a button.
Inside the button event I have a particular condition which I need to fire an alert box.
But the problem is I need to fire an alert, but page load has already finished. ( RegisterClientScript wont work)
Anyone have an idea. I do not know in page load wether I should create the alert or not.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Ista wrote: But the problem is I need to fire an alert, but page load has already finished. ( RegisterClientScript wont work)
Why do you think that it doesn't work?
---
b { font-weight: normal; }
|
|
|
|
|
I already tried it.
But its because the button event firest after page load and the Register script are created at the end of PageLoad.
I could however have a hidden field and have a javascript function that evaluates that hidden field and pops the alert box in the onLoad event of the body. But thats kinda ugly.
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Ista wrote: But its because the button event firest after page load and the Register script are created at the end of PageLoad.
What script is created at the end of PageLoad? How does that affect the popup script?
---
b { font-weight: normal; }
|
|
|
|
|
I think were on different wavelengths here.
I need to create a javascript in the button event.
The ClientManager.RegisterClientScript is added at the end of PageLoad.
So, unless theres another Register event that the button can fire to create my script, I have to use a hack with the hidden values.
Although I'm learning about client script callbacks and maybe that will solve it.
Thanks for trying to help,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Ista wrote: I think were on different wavelengths here.
True. You have made an assumption on how RegisterClientScript works that makes you think that you can't use it.
Ista wrote: So, unless theres another Register event that the button can fire to create my script, I have to use a hack with the hidden values.
RegisterClientScript is not an event, it's a method. There is no reason you can't use it more than once in a page.
Actually, if you look at the reference you see that the first two parameters serves no other purpose than handling the situation where you call it repetedly from different parts of the code, that even may be unaware of each other.
---
b { font-weight: normal; }
|
|
|
|
|
Are popup windows a bad design these days with all the popup blockers etc?
I have a really good fit for a popup window in an asp.net business application I'm designing but I'm concerned that the popup window will be in the long run trouble for our less technically savvy potential users.
Is there a do's and don'ts of popup windows anywhere for the modern age?
|
|
|
|
|
I don't remember the code, but IE fires a "pop-up closed" event when it's blocked which you can use to reload the pop-up if it's THAT important to show the pop-up.
As for me, I'd rather steer away from pop-ups. A large part of the public still believe you can get viruses from a pop-up and therefore you'll scare potentioal customers.
If it's indispensable though, do a search on google regarding what I said above Just don't put 'very important info' in the popup as this can be blocked and will result in a diminished experience for the customer. If all else fails, you can always provide a 'Click here to open popup and be my guest' link on the main page.
My two cents anyway...
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
|
|
|
|
|
Thank you, just the sort of opinion I'm after.
My other concern is that people might be using hand held devices with browsers and from what I've seen a popup might be oversized whereas a standard page may layout more usefully on such a device.
|
|
|
|
|
|
Nice links, thank you, lot's of good info there!
Cheers!
|
|
|
|
|
Just a quick idea, but you should be able to show a DIV layer on the click.
If you design it correctly it can serve as a popup...
good luck.
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
|
|
|
|
|
OK, im working on an assignment and I'm running, running, running my web application like crazy. Mod a line, run... mod another 3 lines, run.
Suddenly I realize that my dataset (being filled from a mysql database on load of the ASP.NET web application) seems to be caching my data. I don't know if that's what it's actually doing but sometimes I'm stuck with old data until I wait sometime and re-run.
Now as much as MS thought this was a great idea, it's really bugging me. My friend told me to kill the aspnet_wp (worker process i suppose) when it happens and it works. BUT:
my problem is this: since this is an assignment I need to submit and leave with my lecturer and because my diploma is hanging on this assignment I need to find a fail-safe work-around to this. Don't want it happening to my (less then bright, let me tell ya this) lecturer and get a big, old FAIL!
So I thought... great... I'll kill it programmatically on Session_End in the <font color="blue">Global.asax</font> file but it ain't working. This is my code:
foreach (Process p in Process.GetProcesses())<br />
{<br />
if (p.ProcessName.Equals("msnmsgr.exe"))<br />
{<br />
p.Kill();<br />
break;<br />
}<br />
}
Thanks a lot... you'll save my life :/
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
-- modified at 12:20 Friday 12th May, 2006
Just so you know, I've been trying to close msnmsgr.exe first to be sure it works coz aspnet_wp restarts as soon as it's killed. This way I'll know it's working and then I'll just replace msnmsgr with aspnet_wp
|
|
|
|
|
I'm no expert on this subject, but in general I recommend you find out the root cause of the problem because what you are attempting sounds like a work around to me and the lecturer will likely have a highly trained nose for sniffing out workarounds and lowering the grade accordingly.
|
|
|
|
|
You can write a simple user guide which tells your lecturer to kill the aspnet process everytime he gets stuck with your application .
To be honest, killing the aspnet process is not the right way you go. Here, you have a problem with old cached data, and from your view the application should be running properly even when the data updated. If this is the case, then there are a couple of options which you may try:
+ The ASP.NET 2.0 introduces a cool object named SqlDependency [^] which notifies you to refresh the cache when the original data in the database changes. However, this may cause you another issue as this object requires SQL 2005, but I guess you can use the trial edition.
+ You can set the expiration time for the cache item to a short value.
+ If the cached data is likely to be updated often, you may not need to cache data.
|
|
|
|