|
Sorry I don't understand. I don't think I set the GridData property. And I think I never populate it on postback. It may sound simple to you, but how do I go about doing that?
thanks in advance. Much appreciated.
|
|
|
|
|
blurMember wrote: And I think I never populate it on postback. It may sound simple to you, but how do I go about doing that?
It means, in the first form frm_First, you normally populate the datasource to bind to the dgDisplay datagrid only for the first time, but here you need to access this datasource in the second form with the Server.Transfer method when the button is clicked, you need to populate the datasource in the frm_First again. In a short answer, you need make sure that the GridData property is assigned a value in the first form so that you can access it in the second form after the Server.Transfer method executes. If you still don;t understand, you can post your sample code in the first form, I'll point out your issue.
|
|
|
|
|
blurMember wrote: this.dgDisplay.DataSource=ds;
this.GridData = this.dgDisplay.DataSource;
this.dgDisplay.DataBind();
That's enough. So here you populate the dataset ds and bind it to the grid control in the ShowAllWeek method, you then assign the datagrid's DataSource property to the GridData property of the web page, and I think that the ShowAllWeek does not execute when you hit the button. To fix this code, I suggest you saparate to your code to populate the dataset object in a seperate method, say BuildDataSource, which returns the result populated dataset ds . In the Page_Load of the first form, you can write your code like this:
private void Page_Load(object sender, System.EventArgs e)
{
DataSet ds = BuildDataSource();
this.GridData = ds;
if(!IsPostBack())
{
this.dgDisplay.DataSource=ds;
this.dgDisplay.DataBind();
}
}
|
|
|
|
|
Thank you very much for your help. I realised that if I called the function ShowAllWeek from the Page_Load . The datagrid is able to be transfer the information to another webform. I am confused for the reason it happened it that manner.
You mentioned earlier about BuildDataSource() . Is this correct?
public BuildDataSource()<br />
{<br />
DataSet ds = new DataSet();<br />
this.dgDisplay.DataSource=ds;<br />
this.GridData = this.dgDisplay.DataSource;<br />
this.dgDisplay.DataBind();<br />
}
I know I am extremely weak.
thanks in advance. Much appreciated.
|
|
|
|
|
blurMember wrote: I realised that if I called the function ShowAllWeek from the Page_Load. The datagrid is able to be transfer the information to another webform. I am confused for the reason it happened it that manner.
It's simple, calling the ShowAllWeek method in the Page_Load makes sure that the you bind the datasource again to the grid, and the GridData is assigned the value also.
|
|
|
|
|
I have 2 forms. I am using form1 as my parent and form2 as a child form. I also have a class (clBuffer) name of my class. In my class(clBuffer.cs) i have 4 strings. How do I send value to those strings from parent class, and how do I read them from the child class?
Thanks
|
|
|
|
|
oskardiazdeleon wrote: I am using form1 as my parent and form2 as a child form.
Are they related to in term of inheritance? Basically, you can pass the reference of the clBuffer object from one class to another, so that you can access it from the other class. Another option is that the second class may have access to the first class.
|
|
|
|
|
See my reply in the C# forum.
Be advised, though, that using static variables in a web application means that all users share the same variable.
---
b { font-weight: normal; }
|
|
|
|
|
Can you pass attributes using the hypertext link. e.g
P. R Inc
-- modified at 12:36 Wednesday 5th July, 2006
|
|
|
|
|
Which attributes do you mean? Where do you want to pass them to? Could you be more specific about your context?
|
|
|
|
|
Hello,
I am trying to create a simple link (static) to an access database in my web application. I have removed .mdb extension from the application extensions menu in iis, but every time I run the app and click on this link I get the following error:
The process cannot access the file 'D:\...\accessdb.mdb' because it is being used by another process.
Some googling suggested that maybe .net has cached the file (it's over 30 mb), and has locked it. Can this be prevented? Any help would be appreciated. I'm really spinning my wheels with this one.
Thanks
|
|
|
|
|
Are you providing a link where by users can download this file? Or do you mean you are trying to allow them to open it via a link? The latter is not highly recommended for a number reasons.
|
|
|
|
|
yeah, just a link to download the file is sufficient
|
|
|
|
|
From the error message it looks like you are using the physical address in the link. That means that you are opening the file via your own file system, not via IIS. It also means that only you can access the file, noone else, as the address would refer to their own file system, not your file system.
Use a virtual path instead of a physical path.
---
b { font-weight: normal; }
|
|
|
|
|
Hi Friends,
I have developed one software in ASP.NET . Now I want to create Menus .So please help me how to create the menus.
Biswa Ranjan Nanda
Software Engineer
Mumbai,INDIA
|
|
|
|
|
There are a couple of free menus on this site that are up for downloads. I myself downloaded some lately and like you was looking for something to use in my ASP.NET application. I find making my own designs a waste of time and prefer to write code.
You can also check out http://www.zeroweb.org/ for endless themes.
Live in fragments no longer. Only connect.
|
|
|
|
|
Where are Free Menus on this site.Can u provide me full path
|
|
|
|
|
Hello all,
Im trying to migrate my web project from ASP to ASP.NET, but I really want to know which will be more efficient 1.1 or 2.0, this is a big web project, and i have to convince my managers that asp.NET 2.0 is better than 1.1, but how?
I wonder if u have samples or links related to this and also related to project management in this kind of projects
We Know By Sharing
We Live By Sharing
|
|
|
|
|
|
2.0 is my advice.
There are many, many good reasons. Here are some of my favorites:
- master pages and themes
- ado.net improvements
- datasource controls and improved data display controls
- navigation and login controls
- language enhancements and partial classes
- membership model
- encryption of connection string /app settings in web.config
- improved configuration api
- web parts
|
|
|
|
|
2.0 is so much better!
Reasons are as follows.
1. Master pages are great. They simplify having a common design.
2. Themes are also cool design your controls and use the same theme everywhere.
3. Your HTML will not change when you switch to desgin view.
4. ObjectDataSource controls are hot, you can bind data to a method in a separate data file. This allows all your code that accesses the database to be in a separate class, very helpful.
5. Gridview is much better then a datagrid.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi Developers
Can I update multiple rows using single query. Let me clear what I need. I have an XML file say
<br />
<br />
<Ad><br />
<id>1000</id><br />
<url>www.codeproject.com</url><br />
</Ad><br />
<br />
<Ad><br />
<id>2003</id><br />
<url>www.hotmail.com</url><br />
</Ad><br />
<br />
.....So on.........
Now in my database table I need to feed each URL value against each id. If I put simple Update Query then I have to execute it so many times how many I have IDs in table.
Is there any possibility that I can do this in single Query(Only one time connection with database should be establish).
Note: I am using MySQL at backEnd
Thanks in advance
Lets work it Out.........!
-- modified at 11:34 Wednesday 5th July, 2006
|
|
|
|
|
fetch all the id's from the database table and concatenate them to form a comma-separated string. like: 1000,2003,2005,....
then pass this comma separated string in the update query
UPDATE table_name SET column_name = 'new_value'
WHERE id IN (1000,2003,2005)
hope that helps......if this is not what you were looking for then plz explain your problem a bit more so that i can understand it properly and help you out
|
|
|
|
|
Hello all,
I am wondering if it is possible to have a flash player play .asx files (XML files that point to a URL for video streaming) and have the following characteristic... The file which is played needs to be able to be dynamically specified. (depending on user action)... Any help would be awesome...
I am using ASP.NET 2.0 C#, Flash MX 2004 Pro
Thanks in advance...
Brandon
|
|
|
|
|
Hi All,
Can i hide the full address from the address bar?.
I mean that when i select www.mysite.com/page1.aspx or www.mysite.com/page2.aspx
i want to show in address bar only 'www.mysite.com'
Thanks
Thomas
|
|
|
|