Very Urgent - Please suggest me a solution

Discussion in 'ASP .Net' started by settyv@gmail.com, Nov 14, 2006.

  1. Guest

    Hi,

    Please help me how can i call the below function on click of datagrid
    hyperlink column.


    public MemoryStream GetMinuteOrderPdf(SearchParams sp)
    {
    DMS dms = new DMS();

    sp.IsMinuteOrder = true;

    return dms.getDocument(sp);//it returns the PDF memory stream
    }




    ASPX code:

    <asp:TemplateColumn HeaderText="Minute Order" >
    <ItemTemplate>
    <asp:HyperLink
    NavigateUrl=<%#GetMinuteOrderPdf(DataBinder.Eval(Container.DataItem,"Minute
    Order"))%> ></asp:HyperLink>
    </ItemTemplate>
    </asp:TemplateColumn>


    Please help me how can i call this function.Is there any way to do
    this?


    Thanks,
    Vishnu
     
    , Nov 14, 2006
    #1
    1. Advertising

  2. You can't do it from a hyperlink column as that does not create the event. If
    you MUST use a hyperlink column, then call a new page (or pass a querystring
    parameter to this page) and call the function from that.

    You would normally use a linkbutton or button to cause an event, then in
    that event, generate your PDF.

    Hope this helps.

    Regards,
    Dave Colliver.
    http://www.AshfieldFOCUS.com
    ~~
    http://www.FOCUSPortals.com - Portal franchises available


    "" wrote:

    >
    > Hi,
    >
    > Please help me how can i call the below function on click of datagrid
    > hyperlink column.
    >
    >
    > public MemoryStream GetMinuteOrderPdf(SearchParams sp)
    > {
    > DMS dms = new DMS();
    >
    > sp.IsMinuteOrder = true;
    >
    > return dms.getDocument(sp);//it returns the PDF memory stream
    > }
    >
    >
    >
    >
    > ASPX code:
    >
    > <asp:TemplateColumn HeaderText="Minute Order" >
    > <ItemTemplate>
    > <asp:HyperLink
    > NavigateUrl=<%#GetMinuteOrderPdf(DataBinder.Eval(Container.DataItem,"Minute
    > Order"))%> ></asp:HyperLink>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    >
    >
    > Please help me how can i call this function.Is there any way to do
    > this?
    >
    >
    > Thanks,
    > Vishnu
    >
    >
     
    =?Utf-8?B?RGF2aWQgQ29sbGl2ZXI=?=, Nov 14, 2006
    #2
    1. Advertising

  3. Guest

    Thanks for your suggestion.So you meant to say that the below code will
    work assuming that i declared linkbutton in the datagrid control:

    protected void grdMinSearch_ItemDataBound(object sender,
    DataGridItemEventArgs
    e)
    {
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
    ListItemType.AlternatingItem)
    {
    LinkButton btn = e.Item.FindControl("linkView") as
    LinkButton;
    Minute Min=new Minute();

    e.Item.Attributes["onclick"] =
    Min.GetMinuteOrderPdf(SearchParams sp);


    btn.Style[HtmlTextWriterStyle.Display] = "none";


    }
    }

    Please comment on this.

    Thanks,
    Vishnu

    David Colliver wrote:
    > You can't do it from a hyperlink column as that does not create the event. If
    > you MUST use a hyperlink column, then call a new page (or pass a querystring
    > parameter to this page) and call the function from that.
    >
    > You would normally use a linkbutton or button to cause an event, then in
    > that event, generate your PDF.
    >
    > Hope this helps.
    >
    > Regards,
    > Dave Colliver.
    > http://www.AshfieldFOCUS.com
    > ~~
    > http://www.FOCUSPortals.com - Portal franchises available
    >
    >
    > "" wrote:
    >
    > >
    > > Hi,
    > >
    > > Please help me how can i call the below function on click of datagrid
    > > hyperlink column.
    > >
    > >
    > > public MemoryStream GetMinuteOrderPdf(SearchParams sp)
    > > {
    > > DMS dms = new DMS();
    > >
    > > sp.IsMinuteOrder = true;
    > >
    > > return dms.getDocument(sp);//it returns the PDF memory stream
    > > }
    > >
    > >
    > >
    > >
    > > ASPX code:
    > >
    > > <asp:TemplateColumn HeaderText="Minute Order" >
    > > <ItemTemplate>
    > > <asp:HyperLink
    > > NavigateUrl=<%#GetMinuteOrderPdf(DataBinder.Eval(Container.DataItem,"Minute
    > > Order"))%> ></asp:HyperLink>
    > > </ItemTemplate>
    > > </asp:TemplateColumn>
    > >
    > >
    > > Please help me how can i call this function.Is there any way to do
    > > this?
    > >
    > >
    > > Thanks,
    > > Vishnu
    > >
    > >
     
    , Nov 14, 2006
    #3
  4. David Guest

    Hi,

    I can't see anything wrong with that, though there may be some others with
    more experience than me that might be able to see any potential issues.

    Best regards,
    Dave Colliver.
    http://www.BracknellFOCUS.com
    ~~
    http://www.FOCUSPortals.com - Local franchises available


    <> wrote in message
    news:...
    >
    >
    > Thanks for your suggestion.So you meant to say that the below code will
    > work assuming that i declared linkbutton in the datagrid control:
    >
    > protected void grdMinSearch_ItemDataBound(object sender,
    > DataGridItemEventArgs
    > e)
    > {
    > if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
    > ListItemType.AlternatingItem)
    > {
    > LinkButton btn = e.Item.FindControl("linkView") as
    > LinkButton;
    > Minute Min=new Minute();
    >
    > e.Item.Attributes["onclick"] =
    > Min.GetMinuteOrderPdf(SearchParams sp);
    >
    >
    > btn.Style[HtmlTextWriterStyle.Display] = "none";
    >
    >
    > }
    > }
    >
    > Please comment on this.
    >
    > Thanks,
    > Vishnu
    >
    > David Colliver wrote:
    >> You can't do it from a hyperlink column as that does not create the
    >> event. If
    >> you MUST use a hyperlink column, then call a new page (or pass a
    >> querystring
    >> parameter to this page) and call the function from that.
    >>
    >> You would normally use a linkbutton or button to cause an event, then in
    >> that event, generate your PDF.
    >>
    >> Hope this helps.
    >>
    >> Regards,
    >> Dave Colliver.
    >> http://www.AshfieldFOCUS.com
    >> ~~
    >> http://www.FOCUSPortals.com - Portal franchises available
    >>
    >>
    >> "" wrote:
    >>
    >> >
    >> > Hi,
    >> >
    >> > Please help me how can i call the below function on click of datagrid
    >> > hyperlink column.
    >> >
    >> >
    >> > public MemoryStream GetMinuteOrderPdf(SearchParams sp)
    >> > {
    >> > DMS dms = new DMS();
    >> >
    >> > sp.IsMinuteOrder = true;
    >> >
    >> > return dms.getDocument(sp);//it returns the PDF memory stream
    >> > }
    >> >
    >> >
    >> >
    >> >
    >> > ASPX code:
    >> >
    >> > <asp:TemplateColumn HeaderText="Minute Order" >
    >> > <ItemTemplate>
    >> > <asp:HyperLink
    >> > NavigateUrl=<%#GetMinuteOrderPdf(DataBinder.Eval(Container.DataItem,"Minute
    >> > Order"))%> ></asp:HyperLink>
    >> > </ItemTemplate>
    >> > </asp:TemplateColumn>
    >> >
    >> >
    >> > Please help me how can i call this function.Is there any way to do
    >> > this?
    >> >
    >> >
    >> > Thanks,
    >> > Vishnu
    >> >
    >> >

    >
     
    David, Nov 14, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raymond Arthur St. Marie II of III

    very Very VERY dumb Question About The new Set( ) 's

    Raymond Arthur St. Marie II of III, Jul 23, 2003, in forum: Python
    Replies:
    4
    Views:
    518
    Raymond Hettinger
    Jul 27, 2003
  2. Replies:
    3
    Views:
    391
    Milsnips
    Nov 15, 2006
  3. shanx__=|;-

    very very very long integer

    shanx__=|;-, Oct 16, 2004, in forum: C Programming
    Replies:
    19
    Views:
    1,720
    Merrill & Michele
    Oct 19, 2004
  4. Abhishek Jha

    very very very long integer

    Abhishek Jha, Oct 16, 2004, in forum: C Programming
    Replies:
    4
    Views:
    470
    jacob navia
    Oct 17, 2004
  5. jonefer

    Please suggest how to use this timeout solution

    jonefer, Feb 7, 2007, in forum: ASP .Net Security
    Replies:
    0
    Views:
    127
    jonefer
    Feb 7, 2007
Loading...

Share This Page