|
Thanks, but it is not maintaining the viewstate, i need viewstate also, i want to save all the data in the database.
|
|
|
|
|
Hi,
I want links for alphabet A-Z,when click that letter i want filter and dispaly into gridview..
Can anybody give suggestion to do?
|
|
|
|
|
Try This , if anu probs let me know
create Datalist dlist_chars in design
<asp:DataList ID="dlist_chars" Width="100%" CellPadding="5" CellSpacing="5" DataKeyField="PageIndex"
runat="server" RepeatColumns="26" RepeatDirection="Horizontal" OnItemDataBound="dlist_chars_ItemDataBound">
<ItemTemplate>
<asp:LinkButton CssClass="detail_link" ID="lnl_chars" OnClick="LinkButton1_Click"
CommandArgument='<%# Eval("PageText") %>' runat="server" Text='<%#Eval("PageText")%>'></asp:LinkButton>
</ItemTemplate>
</asp:DataList>
private void CreateAlpha()
{
DataTable dt = new DataTable();
dt.Columns.Add("PageIndex");
dt.Columns.Add("PageText");
if (this.ViewState["Paging"] == null)
{
for (int i = 65; i <= 90; i++)
{
DataRow dr = dt.NewRow();
dr[0] = Char.ConvertFromUtf32(i);
dr[1] = Char.ConvertFromUtf32(i);
dt.Rows.Add(dr);
}
this.ViewState["Paging"] = dt;
}
else
dt = (DataTable)this.ViewState["Paging"];
dlist_chars.DataSource = dt;
dlist_chars.DataBind();
}
on link buton click in datalist
protected void LinkButton1_Click(object sender, EventArgs e)
{
LinkButton myButton = sender as LinkButton;
if (myButton != null)
{
string text =(myButton.CommandArgument);
clsEmployee emp = new clsEmployee();
emp.empID = 1;
if (text == "| All")
{
emp.empName = "%";
}
else
{
emp.empName = text;
}
DataSet ds = new DataSet();
// fetcha reccord from another datalist dlist_record then bind
dlist_record.DataSource = ds;
dlist_record.DataBind();
}
}
|
|
|
|
|
If you format your code it'll increase the readability.Now its looking odd.Thank you.
|
|
|
|
|
call function CreateAlpha() in pageload
|
|
|
|
|
Hi,
Please let me know how can i convert
string x="10000000000" to int...
i tried Convert.Int64 but im getting exception that number is too long or too short to store value in INt32..
|
|
|
|
|
I think the number is exceeding the limit of Int32 or Int64
try following code for successfully converting your string to
number
If number >= Int32.MinValue And number <= Int32.MaxValue Then
newNumber = Convert.ToInt32(number)
Console.WriteLine("Successfully converted {0} to an Int32.", _
newNumber)
Else
Console.WriteLine("Unable to convert {0} to an Int32.", number)
End If
You can use the same logic for Int64.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
i think maxvalue for Int64 is 9,223,372,036,854,775,808 which is greater than 10000000000
|
|
|
|
|
pradeep455 wrote: i tried Convert.Int64 but im getting exception that number is too long or too short to store value in INt32..
The error says number is too long or too short to store value in Int32..
So I think you are trying with Int32.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
even i tried with Convert.Int64 also..same error..
and im stroing in Int64 variable..still im getting the error..
|
|
|
|
|
Try using the int64 parser
Int64.Parse(string input)
Best Regards
HE
|
|
|
|
|
ya even that was not working...
|
|
|
|
|
"Was" not working or "is" not working?
The above mentioned solution (int64 + parse) works fine.
Tested:
string test = "10000000000";
System.Int64 int64 = Int64.Parse(test);
and it is totally ok.
|
|
|
|
|
Hi...
I have binary data using image datatype for uploading audio files.-C#
But i can't retrieve it. How can i retrieve it?
Kindly help to resolve this issue.
Thanks,
PUJA FALDU
|
|
|
|
|
|
Thanks for response...
i have tried as you suggest links.
but then also its not working properly... its says that file is currepted...
|
|
|
|
|
When you say "it" says the file is corrupted we have no idea what "it" is. Is it media player? Is it iTunes? We also don't know what you are doing after retrieving the data from the database. Are you streaming to a browser? Are you saving to a file?
|
|
|
|
|
hi..
i am streaming to browser.... how can i do this task?
Thanks.
PUJA FALDU
|
|
|
|
|
Are you sure the player you have supports the codec the file is recorded with? Have you tried saving the file to the filesystem both before saving it to the database and after retrieving from the database rather than streaming and seeing if that works? If the file is corrupted you need to try some debugging steps to track down exactly when in the process the corruption is ocurring.
|
|
|
|
|
Hi
In My application, I am Using Model PopUP
In which data are coming in a grid with paging.
But Problem is that when I am Clicking on 2nd paging, Page Model popup
Become Closed, So Is there any way to stop that model popup,
My model popup is in Update panel
thanks in Advanced
|
|
|
|
|
You're using the ModalPopupExtender from the AjaxToolKit, right? If so, the problem is the occurring postback while paging.
Although i remember that there was a better solution than mine, i unfortunately dont remember the solution itself..So heres mine:
Either put the content of your popup in a seperate updatePanel (if that works for you), or call the Show method of your popupextender
again in the paging event. This way it should stay open (at least i'm doing this somewhere in a click-event of a button and this way it stays open).
Hope this helps somehow.
|
|
|
|
|
Hi!
Make sure that you modalpopup is placed in an updatepanel which has not got chlidrenastrigger.
You have to ensure that the control that causes the popup is not reloaded with the postback.
Andreas Johansson
IT Professional at Office IT Partner i Norrbotten Sweden
What we don't know. We learn. What you don't know. We teach
|
|
|
|
|
Hi All,
I am using Ajax toolkit and extenders for asp.net2.0..I have 3 collapsible panels.I want to collapse/expand all the panels on single panel click...
Do any one out there has code for that..any idea will be helpful..
Thanks in advance..!!
|
|
|
|
|
<asp:DataList ID="cartview" runat="server" BorderColor="#E0E0E0" BorderStyle="Solid"
BorderWidth="1px" CellPadding="0" CellSpacing="0" GridLines="Horizontal" OnItemDataBound="cartview_ItemDataBound"
RepeatColumns="1" Width="528px" OnItemCommand="cartview_ItemCommand" ForeColor="Black">
<FooterStyle BackColor="Black" ForeColor="Black" />
<SelectedItemStyle Font-Bold="True" ForeColor="Black" />
<ItemTemplate>
<table border="2" bordercolor="black" cellpadding="0" cellspacing="0" style="width: 729px">
<tr>
<td style="width: 760px">
<table border="0">
<tr>
<td style="width: 760px;">
<asp:Panel ID="pnlExpand" runat="server" BackImageUrl="~/images/bg-menu-main.png"
Width="775px">
<div style="vertical-align: middle; cursor: pointer;">
<table width="774" border="1" cellpadding="0" cellspacing="0">
<tr>
<td style="width: 90px; height: 30px; padding-left: 5px;" align="left">
<asp:Label ID="lblTxnId" runat="server" ForeColor="White" Text='<%# Eval("TxnId") %>'
Font-Bold="True" Font-Size="11px" Font-Names="Verdana" Width="60"></asp:Label>
<asp:HiddenField ID="hdTxnType" Value='<%# Eval("txntype") %>' runat="server" />
</td>
<td align="left" style="width: 180px;">
<asp:Label ID="lblDesignName" runat="server" Font-Bold="True" ForeColor="White" Text='<%# Eval("designname") %>'
Font-Size="11px" Font-Names="Verdana"></asp:Label></td>
<td align="center" style="width: 180px;">
<asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Size="11px" ForeColor="White"
Text='<%# Eval("TxnDate") %>' Font-Names="Verdana"></asp:Label></td>
<td colspan="2" align="center" style="width: 170px">
<asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="11px"
ForeColor="White" Text='<%# Eval("AdminStatus") %>'></asp:Label></td>
<td align="center" style="width: 70px;">
<asp:ImageButton ID="imgbtnnewmessage" runat="server" AlternateText="(Show Messages....)"
ImageUrl="~/images/post.gif" CommandName="newmessagehdr" Height="20px" /></td>
<td align="right" style="width: 20px;">
<asp:ImageButton ID="Image1" runat="server" AlternateText="(Show Detalis....)" ImageUrl="../images/expand_blue.jpg" /></td>
</tr>
</table>
</div>
</asp:Panel>
</td>
<td style="width: 142px;">
<asp:Button ID="btnArchive" CommandName="movetoarchive" runat="server" CssClass="button_ina"
Text="Move to Archive" Width="110px"></asp:Button>
</td>
</tr>
</table>
<asp:Panel ID="pnlControlID" runat="server" CssClass="collapsePanel">
<table border="0">
<tr>
<td align="center" bgcolor="#000000" style="background-color: #dcdcdc; text-align: center;">
<asp:GridView AutoGenerateColumns="False" CellPadding="1" CellSpacing="1" CssClass="input"
GridLines="None" ID="GridView2" OnPageIndexChanging="GridView2_PageIndexChanging"
OnRowCommand="GridView2_RowCommand" OnRowDataBound="GridView2_RowDataBound" runat="server"
DataKeyNames="txntype,SubTxnID,txnTypeK,txnid" Width="770px" Font-Names="Verdana"
Font-Size="11px" Font-Strikeout="False" BackColor="Silver">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:Button CommandArgument="<%#((GridViewRow)Container).RowIndex%>" CommandName="View"
Font-Bold="True" ID="lnkbtn1" runat="server" Text="View Details" ToolTip="Click to see the specifications of this quotation/order/edit."
Font-Names="Arial" Font-Size="12px" ForeColor="red"></asp:Button></td>
<td>
<asp:Button CommandArgument="<%#((GridViewRow)Container).RowIndex%>" CommandName="Edit"
Font-Bold="True" ID="LinkButton1" runat="server" Text="Edit Design" Font-Names="Arial"
Font-Size="12px"></asp:Button></td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="SubTxnId" HeaderText="Quotation No." />
<asp:BoundField DataField="SubTxnId" HeaderText="Order No." />
<asp:BoundField DataField="SubTxnId" HeaderText="Edit No." />
<asp:BoundField DataField="subtxnref" HeaderText="Order/Edit reference" />
<asp:TemplateField HeaderText="Order Type">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("txnTypeK") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("txnTypeK") %>' Font-Names="Verdana"
Font-Size="11px"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Chase Order">
<ItemTemplate>
<%--<input type ="button" id ="btnchase" value="Chase Order" Class="button_ina" onClick="window.open('message.aspx?keepThis=true<%# Eval("SubTxnId")%>&TxnID=<%# Eval("TxnId")%>','mywindow','width=800,height=425','resizable=true')"/>--%>
<span><a href="#" onclick="window.open('Message.aspx?keepThis=true<%# Eval("SubTxnId")%>&TxnID=<%# Eval("TxnId")%>','mywindow','width=800,height=525, resizable=1')"
title="Message" style="color: Red;">
<asp:Label ID="btnchase" Text="Chase Order" ForeColor="black" runat="server" Height="20px"
Width="35" /></a></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText=" Message">
<ItemTemplate>
<span style="padding-left: 15px;"><a onclick="window.open('ReadMessages.aspx?keepThis=true<%# Eval("SubTxnId")%>&TxnID=<%# Eval("TxnId")%>','mywindow','width=800,height=725, resizable=1')"
title="Message" style="color: Red;">
<asp:Image ID="imgbtnnewmsg" ImageUrl="~/images/post.gif" runat="server" Height="20px"
Width="25px" /></a> </span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkbtnacancelorder" runat="server" CommandArgument="<%#((GridViewRow)Container).RowIndex%>"
CommandName="cancelorder" Width="150px" ForeColor="red">Cancel Order</asp:LinkButton>
</ItemTemplate>
<HeaderTemplate>
<a href="" class="showTip L5">Terms</a>
</HeaderTemplate>
</asp:TemplateField>
<asp:BoundField DataField="TxnId" Visible="false" HeaderText="Txn No." />
</Columns>
<RowStyle BackColor="AliceBlue" BorderColor="SkyBlue" BorderStyle="Solid" BorderWidth="1px"
CssClass="input" ForeColor="#333333" HorizontalAlign="Left" Width="20px" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" Height="25px"
HorizontalAlign="Left" Font-Names="Arial" Font-Size="12px" Font-Strikeout="False" />
<AlternatingRowStyle ForeColor="#284775" />
</asp:GridView>
<br />
</td>
</tr>
</table>
</asp:Panel>
<ajaxToolkit:CollapsiblePanelExtender ID="cpeDemo" runat="Server" CollapseControlID="pnlExpand"
Collapsed="True" CollapsedImage="../images/show.gif" CollapsedText="(Show Details...)"
ExpandControlID="pnlExpand" ExpandedImage="../images/close.gif" ExpandedText="(Hide Details...)"
ImageControlID="Image1" SkinID="CollapsiblePanelDemo" SuppressPostBack="true"
TargetControlID="pnlControlID" TextLabelID="Label1">
</ajaxToolkit:CollapsiblePanelExtender>
</td>
</tr>
</table>
</ItemTemplate>
<ItemStyle BorderStyle="None" Font-Names="Verdana" ForeColor="Black" />
<SeparatorStyle BorderStyle="None" />
<HeaderTemplate>
<table align="center" border="0" cellpadding="1" cellspacing="1" style="height: 26px;
color: #ffffff; background-color: transparent; width: 890px;" class="top_hearder_panel">
<tr>
<td align="left" style="width: 90px; height: 18px; color: #000000; font-size: 12px;
font-family: Arial; padding-left: 10px;">
TXN NO.</td>
<td align="left" style="width: 195px; height: 18px; color: #000000; font-size: 12px;
font-family: Arial;">
DESIGN NAME</td>
<td align="left" style="width: 150px; height: 18px; color: #000000; font-size: 12px;
font-family: Arial;">
SENT DATE TIME</td>
<td colspan="2" align="center" style="width: 175px; color: #000000; height: 18px;
color: #000000; font-size: 12px; font-family: Arial;">
STATUS</td>
<td align="left" style="color: #000000; height: 18px; color: #000000; font-size: 12px;
font-family: Arial;">
MESSAGES
</td>
<td align="left" bgcolor="#ffcc66" style="color: #000000; height: 18px; color: #000000;
font-size: 12px; font-family: Arial;">
<a href="ArchiveHistory.aspx" class="showTip L2">
<asp:Label ID="lblarchivehistory" ForeColor="black" runat="server" Text="ArchiveHistory"></asp:Label></a>
</td>
</tr>
</table>
</HeaderTemplate>
<HeaderStyle BackColor="#BDC0C7" BorderColor="#DDDDDD" BorderStyle="Solid" BorderWidth="1px"
Font-Bold="True" Font-Names="Verdana" Font-Size="11px" ForeColor="Black" Height="25px" />
</asp:DataList>
|
|
|
|
|
What's the problem? In the collapse/Expand event, write the logic to expand/collapse all of them at once.
|
|
|
|