|
Start with the first part of your question which is staright forward.
You want to display data from a database in a gridview or table?
Use a simple article on the web to leanr how to display data from a datbase, it would be easier then me explaining it to you
We are not a Code Charity
|
|
|
|
|
Hi,
I need to use a Dropdownlist in the PagerTemplate of the gridview. The dropdownlist contains
all the page numbers. When I select a different page number from the dropdownlist, the grid must move to
the selected page. My gridview looks like this:
<pre> <asp:gridview id="grdProds">
runat="server"
Width="100%"
EmptyDataText="No product(s) found."
PageSize="5"
AllowPaging="true"
PagerSettings-NextPageText="Next"
PagerSettings-PreviousPageText="Previous"
PagerSettings-Mode="NextPrevious"
PagerSettings-Position="Bottom"
PagerStyle-CssClass="HyperLinkStyle1"
CssClass="Grid"
ShowHeader="False"
BorderStyle="None"
GridLines="None"
ShowFooter="true"
AutoGenerateColumns="False"
OnPageIndexChanging="grdProds_PageIndexChanging" OnDataBound="grdProds_DataBound" OnRowDataBound="grdProds_RowDataBound" >
<columns>
<asp:templatefield>
<itemtemplate>
<asp:hyperlink id="hLink" runat="server" navigateurl=""><![CDATA[<%# Eval("Category_Id", "~/Products.aspx?CatID={0}") %>]]>'
Text='<%# Eval("Product_Name") %>' CssClass="HyperLinkStyle1"></asp:hyperlink>
<br />
<asp:label id="lblDesc" text=""><![CDATA[<%# Eval("Product_Short_Description") %>]]>' runat="server" CssClass="SCTextLarge" />
<br />
<br />
<span id="spPrice" runat="server">
<b>Price:</b>
<asp:label>
ID="lblPrice"
runat="server"
Text='<%# Eval("Product_Price","{0:C2}") %>'
CssClass="SCText"
/>
<br />
<b>Qty:</b>
<asp:textbox>
id="txtQty"
runat="server"
MaxLength="4"
Width="15%"
Text="1"
/>
<asp:comparevalidator>
ID="comQty"
runat="server"
ControlToValidate="txtQty"
Type="Integer"
Operator="dataTypeCheck"
ErrorMessage="*"
SetFocusOnError="true"
/>
<asp:requiredfieldvalidator>
ID="reqQty"
runat="server"
ControlToValidate="txtQty"
ErrorMessage="*"
SetFocusOnError="true"
/>
<asp:button>
id="btnAddToCart"
runat="server"
Text="Add"
CommandName="Add"
CommandArgument='<%# Eval("Product_ID")%>'
OnCommand="OnCommand"
CssClass="SearchButtonStyle"
/>
</asp:button></asp:requiredfieldvalidator></asp:comparevalidator></asp:textbox></asp:label></span>
</asp:label></itemtemplate>
<itemstyle cssclass="GridItem" />
</asp:templatefield>
<asp:templatefield>
<itemtemplate>
<a href=""><![CDATA[<%# SetUrl(Eval("Category_Id"),Eval("Product_Id")) %>]]>' >
<asp:image id="img" runat="server" imageurl=""><![CDATA[<%# GetImageUrl(Eval("product_image_tn_path")) %>]]>' AlternateText="Image not available" />
</asp:image></a>
</itemtemplate>
<itemstyle cssclass="GridImage" />
</asp:templatefield>
</columns>
<pagertemplate>
<table width="100%">
<tr>
<td style="width:70%;">
<center>
<asp:button>
ID="btnPrev"
runat="server"
CommandName="Page"
CommandArgument="Prev"
OnCommand="OnCommand"
CssClass="PagerButton"
Text="Previous"
/>
<asp:dropdownlist>
id="drpPager"
runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="drpPager_SelectedIndexChanged"
Width="10%"
/>
<asp:button>
ID="btnNext"
runat="server"
CommandName="Page"
CommandArgument="Next"
OnCommand="OnCommand"
CssClass="PagerButton"
Text="Next"
onmouseover="this.style.font-weight='bold';"
/>
</asp:button></asp:dropdownlist></asp:button></center>
</td>
<td style="width:30%;">
<asp:label>
id="lblProdsView"
runat="server"
CssClass="PagerText"
/>
</asp:label></td>
</tr>
</table>
</pagertemplate>
<pagersettings mode="NextPrevious" nextpagetext="Next" previouspagetext="Previous" />
<pagerstyle cssclass="HyperLinkStyle1" />
</asp:gridview></pre>
I am setting the grid to the newly selected page in the selectedIndexChanged event of the dropdownlist.
Now when I choose a different page from the drop downlist, the page posts back but the drop downlists SelectedIndexChange event does
not fire.
Can anybody tell me the reason and/or work around. My Intention is to use dropdownlist in the
Pager. If anybody has any other code, please send it to me.
Regards,
Wasif.
|
|
|
|
|
Hi all,
i have a list box and i items are shown from the Ms-Access database.Now i need context menus for adding ,deleting updating the database after right clicking on the this list box items...
pls help me...
thanks in advance..
manikkuttan
|
|
|
|
|
lets start from the top:
You have a listbox containing data from a database
You want a user to be able to click on an item in the listbox and edit it or delete
You also want to give the user the ability to add items to a database.
This is fairly straight forward stuff involving learning to connect to database.
Check this article out for a start:
http://www.aspfree.com/c/a/Microsoft-Access/Connecting-to-a-Microsoft-Access-database-with-ASPNET/
We are not a Code Charity
|
|
|
|
|
Hi,
my aim is not only database manipulation but also and most importantly to adding context menu for list box item on right click
regards,
Manikkuttan
|
|
|
|
|
on button click i open a new pop up window.when i am in that pop up window there will no action takeplace in the master page where i open the pop up window unless i close the popup window.
|
|
|
|
|
deepthy.p.m wrote: there will no action takeplace in the master page
What does that mean?
We are not a Code Charity
|
|
|
|
|
while being in the pop up window, i don't want any action to take place in the master page, unless i have closed the pop up window and returned back to master page. How to do that?
|
|
|
|
|
Ah so you want to disable the masterpage whilst in the pop-up, hmm...
You either have two options here;
1. You dont include the masterpage at all within your pop-up window
2. You write some code to disable all the functions in the code behind masterpage
comprenday?
We are not a Code Charity
|
|
|
|
|
how abt Going for a Ajax Control ?
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
How would ajax control help?
We are not a Code Charity
|
|
|
|
|
Isn't this just a rewrite of your question in the VB forum?
[^]
I suspect nobody really know what you are trying to achieve? A modal form in ASP.NET?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi
guys, can any one let me know , how can i provide a search in my web application to search the whole internet, kindly reply ASAP, thanks in advnace.
|
|
|
|
|
Use www.google.co.uk custom search
We are not a Code Charity
|
|
|
|
|
File upload control with update panel problem is common.
I try with trigger but file upload is working only at second attempt.
in first fileupload control not fetch any file from disk
why this?
|
|
|
|
|
can you post your code please, the explanation is not great
We are not a Code Charity
|
|
|
|
|
we cant upload a file from Upload control in update panel without
we give Trigger to Uploade button in client side. but my problem is that
in code behind
if (fileupload1.HasFile)
{
}
this condition become false in first time I upload File from Fileupload1.
After the first attempt we can fetch the file in any time and above condition become true ; got ?
|
|
|
|
|
When the does the file upload get the file, after this event or beforE?
We are not a Code Charity
|
|
|
|
|
Sending sms to mobile from asp.net without payment is possible ?
if yes or no ? give me both
|
|
|
|
|
Masood Epy wrote: Sending sms to mobile from asp.net without payment is possible ?
I don't think so
Masood Epy wrote: if yes or no ? give me both
You mean Yes and NO ?
|
|
|
|
|
I already met a code(without payment) in codeproject but its not working.
if any possible way explain that? Your jok is not sutable in my webpage.
|
|
|
|
|
Masood Epy wrote: I already met a code(without payment) in codeproject but its not working.
If it is in an article, that article will have a discussion board which you can use to contact the author, but it's very tough to get a provider who offer free service.
|
|
|
|
|
Masood Epy wrote: Your jok is not sutable in my webpage.
Oh dear that person will be so disappointed
Masood Epy wrote: I already met a code(without payment) in codeproject but its not working.
When you say payment are you talking about paying for the code? or the network charge?
There is no way to send a text to a phone without paying a fee to the network.
We are not a Code Charity
|
|
|
|
|
|
hi,
How we can get web browser height and width information on the same page.If anybody knows plz reply me.
.Thanks
Rajendran.AL
|
|
|
|