|
I have deployed a web application in web farm scenario with a load balancer and multiple servers. If a request coming to one server it works but if to the other server it not works. What issues can it have??
|
|
|
|
|
|
Can any body guide me that how to split json format reply, in webresponse ?
|
|
|
|
|
|
Hi,
Why I am getting the above error for this line:
TitleLabel.Text = data_table.Rows[0]["post_category_name"].ToString() + " - " + data_table.Rows[0]["member_channel_name"].ToString();
here is my stored procedure:
BEGIN
SELECT DISTINCT
post_category.post_category_guid,
post_category.post_category_name,
web_members.web_member_guid,
member_channels.member_channel_address,
member_channels.member_channel_name
FROM
post_category
INNER JOIN member_posts ON member_posts.member_post_category = post_category.post_category_id
INNER JOIN member_channels ON member_posts.member_channel_id = member_channels.member_channel_id
INNER JOIN web_members ON member_channels.web_member_id = web_members.web_member_id
WHERE member_channels.member_channel_address = param_web_address;
END
Technology News @ www.JassimRahma.com
|
|
|
|
|
As per your code, it does not seem issue here. I'll advise you first run your Proc and see whether it is running and resturning data correclty.
Then you debug your code and check the datatable in immidiate window and see it in visualiser what columns are available in datatable.
|
|
|
|
|
So you get the error "Hi"
Never seen that error before. That's a new one for me.
|
|
|
|
|
Hello *,
I aked my question a few days ago on stack overflow but I'am not lucky with the one answer. Perhaps, someone can help me here.
My first controller method is:
[HttpGet]
public ActionResult Item()
In this method, I have some business logic like retrieve the user id with sql or watch out if a user has the permission to see some regions on the view or whatever.
I used bool variables in my viewbag and get these data with razor.
It's only one case..
Now, the user is going to fill data in a form, will make a post and then I call the same method, but with a [HttpPost()] flag (I saw it in many tutorials).
[HttpPost]
public ActionResult Item(FormCollection formCollection)
Ok, now I can collect the values out of the form and can work with them.
BUT if this function is ready, it gives as standard View() back and I can't made the business logic like in the Get() method or must I really copy/pase all these stuff or get it in a own function and call it two times?
Here is a link to my stack overflow question, perhaps you unterstand me better with that:
Stack Overflow question
Best regards, Patrik
|
|
|
|
|
Hi Patric.
It seems that what you described as "some business logic" is some common processing that you want to fire in both GET and POST methods. In that case you can refactor it as separate method.
If that logic is valid only inside that one controller you can make private method that is called by both Item() methods - private controller methods are not mapped to MVC actions.
If it is more application wide you can also consider refactoring it out to some helper class.
BTW - copy/paste should be banned in any development environment
Regards,
Mariusz.
--
"My software never has bugs. It just develops random features."
|
|
|
|
|
Guys;
I have published a website to a remote sever.
The get requests to page returns the correct HTML response, but request to javasript and and css files returns a blank response.
Help people,so poeple can help you.
|
|
|
|
|
With what you mention, I will start looking if the files are present at the path they should be. Relative paths as per deployment can be different then development environment. Using ResolveUrl helps.
|
|
|
|
|
No, Sir.
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?
I mean what is the use of a web server that doesn't support static content requests?
Help people,so poeple can help you.
|
|
|
|
|
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
|
|
|
|