Forum Structure Problem
-
Hi, I am creating a forum type. This forum consists of many sub forums in it for example: Computers, Gadgets, Music etc.... Users will login to use this forum for their own use of trading objects and bidding on object. The problems I am facing right now that I don't know are these: 1. I know how to make a datagrid with pages (After 10 post it creates another page) .. but I don't know how to access the second page of that datagrid. Can anyone help me in this pls? 2. How to upload pictures into asp.net using Ms Access Microsoft not sql. 3. How to make links from a datagrid (each row has a link) to a specific page. How can I make this happen because i dont know how to grab a specific link that the user chose. Help me in this pls!! Thanks alot for any feedback :D
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
-
Hi, I am creating a forum type. This forum consists of many sub forums in it for example: Computers, Gadgets, Music etc.... Users will login to use this forum for their own use of trading objects and bidding on object. The problems I am facing right now that I don't know are these: 1. I know how to make a datagrid with pages (After 10 post it creates another page) .. but I don't know how to access the second page of that datagrid. Can anyone help me in this pls? 2. How to upload pictures into asp.net using Ms Access Microsoft not sql. 3. How to make links from a datagrid (each row has a link) to a specific page. How can I make this happen because i dont know how to grab a specific link that the user chose. Help me in this pls!! Thanks alot for any feedback :D
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
solutions: 1. in the datagrid set PagerStyle for the type of pagination. write an event handler for PageIndexChanged event. if your datagrid id is dg then the code will be something like this
private void dg_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e) { dg.CurrentPageIndex = e.NewPageIndex; }
2. I cannot understand your question. If your question is related to uploading file to webserver, you can use <input type="file" /> and then use the SaveAs method of HttpPostedFile. 3. you can use HyperlinkColumn in the datagrid, or use a <a> in a TemplateColumn. Hope this information will suffice your need. Thanks,Pradipta Basu
-
solutions: 1. in the datagrid set PagerStyle for the type of pagination. write an event handler for PageIndexChanged event. if your datagrid id is dg then the code will be something like this
private void dg_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e) { dg.CurrentPageIndex = e.NewPageIndex; }
2. I cannot understand your question. If your question is related to uploading file to webserver, you can use <input type="file" /> and then use the SaveAs method of HttpPostedFile. 3. you can use HyperlinkColumn in the datagrid, or use a <a> in a TemplateColumn. Hope this information will suffice your need. Thanks,Pradipta Basu
Hi Pradipta, Thanks for your help man. I have some questions to ask please. For my first answer you told me .. "dg.CurrentPageIndex = e.NewPageIndex;" .. what is the NewPageIndex Please?? because when I made e. .. the only thing there was is getType. Second question is for the pictures. I need to make the users to upload their picture on my forum. I am using an MS Access 2003 not SQL. I dont know how make this happen. I dont know where can I begin with thats why? Third question .. I want a datagrid that will show the details of the object the users signed in. I want a hyperlink within every row. This link directs the users into a page with more details about that specific row (object). How can i make this please?
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
-
Hi, I am creating a forum type. This forum consists of many sub forums in it for example: Computers, Gadgets, Music etc.... Users will login to use this forum for their own use of trading objects and bidding on object. The problems I am facing right now that I don't know are these: 1. I know how to make a datagrid with pages (After 10 post it creates another page) .. but I don't know how to access the second page of that datagrid. Can anyone help me in this pls? 2. How to upload pictures into asp.net using Ms Access Microsoft not sql. 3. How to make links from a datagrid (each row has a link) to a specific page. How can I make this happen because i dont know how to grab a specific link that the user chose. Help me in this pls!! Thanks alot for any feedback :D
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
-
Hi Pradipta, Thanks for your help man. I have some questions to ask please. For my first answer you told me .. "dg.CurrentPageIndex = e.NewPageIndex;" .. what is the NewPageIndex Please?? because when I made e. .. the only thing there was is getType. Second question is for the pictures. I need to make the users to upload their picture on my forum. I am using an MS Access 2003 not SQL. I dont know how make this happen. I dont know where can I begin with thats why? Third question .. I want a datagrid that will show the details of the object the users signed in. I want a hyperlink within every row. This link directs the users into a page with more details about that specific row (object). How can i make this please?
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
1. look here, when the pagination is on, it comes in number format, like 1,2,3,... or in Previous/Next format. consider the previous next format. when you are in page 5, and click next, the next page index is 6. so e.NewPageIndex = 6. 2. I will prefer to keep the images in a folder in the webserver, and keep the path of the images in database. This is done the way I have told in my previous mail. 3. Lets say your object id is objid in the database and you are binding the datagrid with a datatable which get filled from the database table of objects. Now the column will be something like this
<asp:TemplateColumn HeaderText="Object ID" Visible="False"> <ItemTemplate> <a id="lnkID" runat="server" href='Newpage.aspx?id=<%# DataBinder.Eval (Container.DataItem, "ID") %>'>><%# DataBinder.Eval (Container.DataItem, "ID") %></a> </ItemTemplate> </asp:TemplateColumn>
For more on datagrids, read my article How to create the id of <td> and <tr> generated by DataGrid in ASP.NET and use it by client-side JavaScript. Hope this will do.Pradipta Basu