473,387 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Urgent- Please help me

Hi,

How do i call the below function on click of datagrid row.I want to
use hyperlink column.How do i call this function from hyperlink column
in a datagrid.
public MemoryStream GetMinuteOrderPdf(SearchParams sp)
{
DMS dms = new DMS();

sp.IsMinuteOrder = true;

return dms.getDocument(sp);
}
ASPX code:

<column>
<asp:TemplateColumn >
<ItemTemplate>
<asp:LinkButton ID="linkView" runat="server"
CausesValidation="false" CommandName="View"
Text="View PDF"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
</column>

Code Behind:

protected void DataGrid1_ItemDataBound(object sender,
DataGridItemEventArgs
e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
LinkButton btn = e.Item.FindControl("linkView") as
LinkButton;
e.Item.Attributes["onclick"] =
GetMinuteOrderPdf(SearchParams sp);


btn.Style[HtmlTextWriterStyle.Display] = "none";
}
}
Will this work? Please let me know.

Thanks,
Vishnu

Nov 13 '06 #1
1 866
If you don't mind a post back then you could store the search parameters in
a hidden textbox. Then look for the values and if present with
if(IsPostBack) use them then clear the textbox.

The better solution would be to use ASP.Net AJAX.

Regards,
Brian K. Williams
<se****@gmail.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
Hi,

How do i call the below function on click of datagrid row.I want to
use hyperlink column.How do i call this function from hyperlink column
in a datagrid.
public MemoryStream GetMinuteOrderPdf(SearchParams sp)
{
DMS dms = new DMS();

sp.IsMinuteOrder = true;

return dms.getDocument(sp);
}
ASPX code:

<column>
<asp:TemplateColumn >
<ItemTemplate>
<asp:LinkButton ID="linkView" runat="server"
CausesValidation="false" CommandName="View"
Text="View PDF"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
</column>

Code Behind:

protected void DataGrid1_ItemDataBound(object sender,
DataGridItemEventArgs
e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
LinkButton btn = e.Item.FindControl("linkView") as
LinkButton;
e.Item.Attributes["onclick"] =
GetMinuteOrderPdf(SearchParams sp);


btn.Style[HtmlTextWriterStyle.Display] = "none";
}
}
Will this work? Please let me know.

Thanks,
Vishnu

Jan 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Johnson Ndiovu | last post by:
This is a multi-part message in MIME format --af4b847f-30bf-4b8d-acf1-2909de953a6e Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable DEAR FRIEND, ...
9
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target...
3
by: gani | last post by:
hi, how to get the fullpath of created IsolatedStorage directory. thanks. -- gani
28
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
16
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
7
by: zeyais | last post by:
Here is my HTML: <style> ..leftcolumn{float:left;width:300px;border: 1px solid #ccc} ..rtcolumn{float:left;width:600px;border: 1px solid #ccc} </style> <body> <div class="leftcolumn"...
8
by: ginnisharma1 | last post by:
Hi All, I am very new to C language and I got really big assignment in my work.I am wondering if anyone can help me.........I need to port compiler from unix to windows and compiler is written...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
1
by: rajesh.us.it.recruiter | last post by:
Hi Guys/Partners, We have a URGENT Requirement for Perl Programmer with H1 visa in India/US for one of our prestigious Client. Location : New Jersey Requirements : Should be very strong in...
7
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.