|
Ali Al Omairi(Abu AlHassan) wrote: It was because the static content module wasn't installed.
Now, the question is; why isn't this feature checked by default when installing IIS7?
Interesting. Thanks for sharing the same.
|
|
|
|
|
Hi,
I have the following in Main.Master file:
ViewState["member_id"] = Convert.ToString(sql_reader["member_guid"]);
and in banner.ascx which is embedded in the Main.Master, I have the following:
<a href="<%# String.Format("{0}/{1}", Page.RouteData.Values["ADDRESS"], Eval("post_guid")) %>"><img src="<%# String.Format("{0}/{1}/posts/{2}/{3}.png", Application["MemberMediaDirectory"], ViewState["member_guid"], Eval("post_guid"), Eval("member_post_media_guid")) %>" alt="<%# Eval("member_post_media_title") %>" title="<%# Eval("member_post_media_title") %>" width="906px" height="360px" id="<%# Eval("member_post_media_id") %>"/></a>
but the ViewState["member_id"] is getting lost there and it's just blank! how can I fix it please?
Technology News @ www.JassimRahma.com
|
|
|
|
|
Where are you assigning the view state at?
I think you have to assign the value in init in code behind, before page load.
If I remember correct, the webform elements load first, and then page.load fires in the page life cycle
Edit:
My mistake about the master page holding its own view state which is not shared. But I am correct about loaing the viewstate in page.init to hold its value during partial page post backs, and not page load
modified 23-Jan-13 3:15am.
|
|
|
|
|
Jassim Rahma wrote: I have the following in Main.Master file:
...
and in banner.ascx which is embedded in the Main.Master, I have the following:
ViewState is not inherited by child controls. Anything you set in the master page will only be available in the master page.
http://msdn.microsoft.com/en-us/library/ms972976.aspx[^]
If you want to share some state across the entire page, try the Page.Items[^] collection.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
please give me a good solution for exporting the data into csv format file.
|
|
|
|
|
|
Hi, I am trying to insert some date to my SQL-Server using ASP.Net. But I am getting the error message like, " ExecuteNonQuery: Connection property has not been initialized." I am using store procedure to store the date. My code is
try
{
SqlCommand cmd = new SqlCommand();
cmd.Parameters.Clear();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "insertdata";
if (rbt_Male.Checked)
{
cmd.Parameters.AddWithValue("@Name", txtbx_Name.Text);
cmd.Parameters.AddWithValue("@Gender_Male", rbt_Male.Text);
cmd.Parameters.AddWithValue("@Email", txtbx_Email.Text);
cmd.Parameters.AddWithValue("@Dob", Convert.ToDateTime(txt_Dob.Text));
}
else if (rbt_Female.Checked)
{
cmd.Parameters.AddWithValue("@Name", txtbx_Name.Text);
cmd.Parameters.AddWithValue("@Gender_Female", rbt_Male.Text);
cmd.Parameters.AddWithValue("@Email", txtbx_Email.Text);
cmd.Parameters.AddWithValue("@Dob", Convert.ToDateTime(txt_Dob.Text));
}
if (con.State == ConnectionState.Closed)
con.Open();
SqlCommand dataCommand = new SqlCommand(sql, dataConnection);
cmd.ExecuteNonQuery();
lbl_Errormsg.Visible = true;
lbl_Errormsg.Text = "Record Inserted Successfully";
con.Close();
}
catch (Exception ex)
{
lbl_Errormsg.Visible = true;
lbl_Errormsg.Text = ex.Message;
}
|
|
|
|
|
cmd.connection="your connection_string_name";
use this before sending parameters.it works.
|
|
|
|
|
Assuming that con has already been initialized, change
SqlCommand dataCommand = new SqlCommand(sql, dataConnection);
to
SqlCommand dataCommand = new SqlCommand(sql, con);
|
|
|
|
|
Hi,.
I am using this to display text from database within asp:Literal:
<asp:Literal ID="Literal1" runat="server" Text='<%# Eval("post_comment_text") %>' ></asp:Literal> I want to know how can I limit the display to x number of characters with more link to display the full text just like the facebook comments?
Technology News @ www.JassimRahma.com
|
|
|
|
|
Through literal you can not do in css until you putting it into label or span or div. You can truncate your string in your code the you can display here.
If you want to use in css then find very clear example to support most of the browser
http://mattsnider.com/css-string-truncation-with-ellipsis/[^]
Parwej Ahamad
|
|
|
|
|
when you are binding the values from any source, create another alias in your selection query.
ex: select fullname,left(fullname,20) as shortname from tablename
the 20 mentioned can be of your need.and then bind the shortname to literal.it works.
|
|
|
|
|
The findcontrol event is not getting the control e.g. "btnSubmit" placed inside a gridview itemtemplate tag.
please help with code in VB.NET
|
|
|
|
|
<ItemTemplate>
<asp:CheckBox ID="chkItemSelect" runat="server" />
<asp:Label ID="lblname" Text='<%#Bind("name")%>' runat="server" />
<asp:Button ID="btnFindx" runat="server" CommandName="Findx" Text="Do Some thing" CommandArgument='<%#Eval("ID")%>'></asp:Button>
</ItemTemplate>
So, in event OnRowCommand(Code Behind) :
Protected Sub GridView_RowCommand(sender As [Object], e As GridViewCommandEventArgs)
Select Case e.CommandName
Case "Findx"
MethodFindControlValue()
Exit Select
End Select
End Sub
..in MethodFindControlValue() :
Private Sub MethodFindControlValue()
For Each row As GridViewRow In ApprovalGrid.Rows
Dim chkItemSelect As CheckBox = CType(row.FindControl("chkItemSelect"), CheckBox)
Dim chkItemSelect As Label = CType(row.FindControl("lblname"), CheckBox)
Dim id As String = Convert.ToString(NameGridView.DataKeys(row.RowIndex).Value.ToString())
Next
End Sub
hope this help you............
|
|
|
|
|
paste the code what you have done till now?..so that we can help you in correcting the errors.
|
|
|
|
|
Thanks for the help dear!
but my case was solved as I used the LINK BUTTON instead of button in the itemtemplate tag of Gridview
|
|
|
|
|
ok...sure...enjoy coding...all the best..
|
|
|
|
|
How to track emails whether the receiver has read the message and reply us in asp.net...
|
|
|
|
|
I am using this to redirect to comment page:
Response.Redirect(String.Format("~/{0}/Comment/{1}", Page.RouteData.Values["ADDRESS"], Page.RouteData.Values["GUID"]), false);
I want, if the user is not signed in to redirect to /signin but with mentioning the original page so when user signs ij it will automatically redirect to the original page. something like:
if (Session["volow_member_id"] == null || Session["volow_member_guid"] == null)
{
Response.Redirect("~/Signin/" + String.Format("~/{0}/Comment/{1}", Page.RouteData.Values["ADDRESS"], Page.RouteData.Values["GUID"]), false);
}
else
{
Response.Redirect(String.Format("~/{0}/Comment/{1}", Page.RouteData.Values["ADDRESS"], Page.RouteData.Values["GUID"]), false);
} how can i do this?
Technology News @ www.JassimRahma.com
|
|
|
|
|
Put your return url into the query string and after login check if you have return url query then to that url or redirect to default page
?ruturnur=your urllllllllllll
Parwej Ahamad
|
|
|
|
|
but my signin url is :
mydomain.com/signin
and the redirect url is:
mydomain.com/myprofile/comment/post-guid-string
so the full url would be something like this (because I am usilg url route mapping):
mydomain.com/signin/www.mydomain.com/myprofile/comment/post-guid-string
which is invalid!
Technology News @ www.JassimRahma.com
|
|
|
|
|
No Url will be:
mydomain.com/signin/?returnurl=www.mydomain.com/myprofile/comment/post-guid-string
Parwej Ahamad
|
|
|
|
|
protected void Page_Init(object sender, EventArgs e)
{
Response.Redirect("~/yourpage.aspx");
}
|
|
|
|
|
How to add KML file to google Map using GGeoXml in javascript in asp.net
|
|
|
|
|
I tried using oledbconnection with excel and exported data into it but it doesn't support on 64bit.
In 32bit it works well.
But in 64bit it works partially.
Can you give me any solution...
|
|
|
|