Md. Nazmul Hoque

You can find me

Worked in Rhone Poulenc Rorer, Fisons Bangladesh Ltd and Sanof-aventis.

Working as a System Engineer in NIK,Japan

Accessing aspx.cs class from javascript

given something like this:
public partial class MyDialog : System.Web.UI.Page
{
    public int ID;
    protected void Page_Load(object sender, EventArgs e)
    {
        ID = Int32.Parse(Request["ID"]);
    }
// etc
}

out of curiosity, is it possible to set ID from a javascript function in an aspx page? i believe that i can read it via '<% ID %>' but can i set it? if so, how? would the same principle hold true in using mutators?

Read more

Published: 1/1/0001 12:00:00 AM

Dynamic Controls inside a gridview

Hi, 

I have a gridview that will have a dynamic contorl in edititem template column based on a value from the database and that works fine i am able to populate the gridview with the correct control. Once the gridveiw has the correct control on it whether it be a textbox, datepicker, dropdownlist or checkbox I need to then allow them to save this into the database but that is were the problem is coming up. It is losing the control that was on the grid when it does the postback so then it is erroring out saying a null reference. I have looked every where and I cannot figure this out. How do i save the value in the dynamic control to the database and also how do i create the contorls for that gridview on page_load as ppl have suggested if i do not know if that row need a textbox or dropdown or whatever. Currently i am creating the contorls on the gridview rowdatabound event. Please help!!!!

Read more

Published: 1/1/0001 12:00:00 AM

How to Call JSON

Hey Gang,

I need to call a URI that returns a JSON string. I have been trying to find an example that does this, and am just not seeing a concrete example of how to do it.

Does anyone have an example of how to call a URI that returns JSON?

Thanks
Jay 

Read more

Published: 1/1/0001 12:00:00 AM

Page title dynamically

Dear

i want to set my page title dynamically so when i run this code it is have error . please solution.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = DetailsView.FindControl("headline").Text.Trim();
    }
}

       <asp:DetailsView ID="DetailsView" runat="server" 
        AutoGenerateRows="False"
        DataKeyNames="articleID" DataSourceID="AccessDataSourceDetailsView" Height="50px" 
        BorderWidth="0px" CellPadding="0" GridLines="None">
        <RowStyle CssClass="rowstyle" />
        <Fields>
        <asp:TemplateField SortExpression="headline" ShowHeader="False">
            <ItemTemplate>
                        <h2><asp:Label ID="headline" runat="server" CssClass="LinkHed" Text='<%# Bind("headline") %>'></asp:Label></h2>
                        <br />
                                                <div align="left">
                        <!-- AddThis Button BEGIN -->
                        <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
                        <a class="addthis_button_preferred_1"></a>
                        <a class="addthis_button_preferred_2"></a>
                        <a class="addthis_button_preferred_3"></a>
                        <a class="addthis_button_preferred_4"></a>
                        <a class="addthis_button_compact"></a>
                        <a class="addthis_counter addthis_bubble_style"></a>
                        </div>
                        <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f887df5708fd1a0"></script>
                        <!-- AddThis Button END -->
                        </div>
                        <br />
                            &#1576;&#1607;&#8204;&#1588;&#1740;&#8204;&nbsp; <asp:Label CssClass="LinkPri" ID="Label1" runat="server" Text='<%# Bind("catName") %>'></asp:Label>&nbsp;  &#1604;&#1607;&#8204;&#1576;&#1607;&#8204;&#1585;&#1608;&#1575;&#1585;&#1740;&#8204; &nbsp; :<asp:Label CssClass="LinkPri" ID="Label2" runat="server" Text='<%# Bind("publishDate") %>'></asp:Label>
                        <br />
                <img src="App_Themes/Shewa/Images/fareza.png" style="border-top-style: 0; border-right-style: 0; border-bottom-style: 0; border-left-style: 0; border-width: 0px; border-top-color: 0; border-right-color: 0; border-bottom-color: 0; border-left-color: 0; float: right" />
                <br />   
                <img src='<%# Eval("pic") %>' width="410" height="170" style="float: left" />
                <asp:Label cssclass="LinkSum" ID="fullStory" runat="server" Text='<%# Bind("fullStory") %>'></asp:Label>

                <img src="App_Themes/Shewa/Images/fareza1.png" style="border-style: 0; border-color: 0; border-width: 0px; float: left" />
            </ItemTemplate>
        </asp:TemplateField>
        </Fields>
        </asp:DetailsView>
       <asp:AccessDataSource ID="AccessDataSourceDetailsView" runat="server" DataFile="App_Data/ASPNetDB.mdb"
            SelectCommand="SELECT News_Articles.*, News_Categories.*, News_Articles.articleID AS Expr1 FROM (News_Articles INNER JOIN News_Categories ON News_Articles.catID = News_Categories.catID) WHERE (News_Articles.articleID = ?)"
            UpdateCommand="UPDATE News_Articles SET hit = hit + 1">
            <SelectParameters>
                <asp:QueryStringParameter Name="articleID" QueryStringField="articalID" 
                    Type="Int32" />
            </SelectParameters>
        </asp:AccessDataSource>




Read more

Published: 1/1/0001 12:00:00 AM

viewstate events

Hi,

I was asked a question and I wasn't sure what answer they were looking for. The question was what are viewstate events?

Can someone please clarify?

Thanks

Read more

Published: 1/1/0001 12:00:00 AM