Updating Common String By Different Users In Same Page?
Mar 14, 2010
I am newbie in asp.net . I want to develope a chat app by my own for my website. Registered users can chat one on one. My logic is pretty simple....
I have an string msg="";
When a user submits a textbox, textbox's text is added to msg. and then msg is displayed to both the users who are chatting. Then, next user submits his textbox , his textbox's text is also added to the msg, and then msg is displayed to both users.
My problem is this, how can I implement this in asp.net ? How to maintain a global (common) msg (string) to both the users who are chatting. Can I implement this in asp.net?
I am using LINQ to SQL files in my class libray since every LINQ to SQL sources file is a seprate file and i have to set database connection string in each class library. Now, i have total 7 class libraires in my project how connection string be passed from web.onfg to LINQ file, so that i don't need to manually change the connection string. lke we did in asp.net 2.0 using connection string property in class file library.
How could we pass the same in LINQ's designer file.
<asp:Content ID="TitleContent1" ContentPlaceHolderID="PageTitlePlaceHolder" runat="Server"> My Page </asp:Content>
This works by placing the content page specific title on the page ("My Page" in this example). Now I want to add a global prefix to the title in my master page for the site name. So I want:
I have a solution I'm working on in VS2010 Professional, using ASP.NET 4.0 with the AJAX Toolkit.This has been working fine, but when I started it up today, I got the runtime exception shown above. This exception occurs on any page with a control from the toolkit.Sometimes when I load a page, I get an exception "Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, ublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified." If I then reload the page (without making any changes), I then get the exception shown in the subject line.I tried dragging an AJAX Toolkit control from the toolbox onto a page, and then deleting it, and that worked - once. The next time I tried the page (or any other), I got the exception again. Dragging a control out didn't help this time.
In general, If multiple users thru an application try to update the same tables in database simultaneously, then by default on what basis the priority will be given.Like if we don't have any extra logic for the locking implemented.
I'm having trouble figuring out how to do the following:On every page (or every page I so desire), I'd like to put a common control widget (e.g. think - Search functionality that contains a textbox+button). What's the best way to do this, and who handles the submit button (assuming it is a submit button)?i.e. what does my ViewUserControl look like? Does it have a form? does it use jQuery onclick""? Does it post to the main View's action method, or can I redirect it to another Controller/Action
I have a function that sends out emails when certain processes are complete. The function works great; however, in our testing lab, I want to be able to see the message that are going out and not have it actually send the messages. Since MsgBox does not work in the web environment, is there a way to open a new page/window from the common code? The page will have the message passed to it for display and I do not want to do a redirect as there are times when more than one email is going out.
I have a form in which I display data from a database table, change the data and then update the database table. The form consists of textboxes, so all data displayed in the form is string. However - one data is int in the database table (the rest is varchar), so I need to convert it from string to int when I update the database table. How do I do it?
[Code]....
And, strangely enough, the same code doesn't work with parameters. How is that?:
My problem is i need to update only the database name in current connection string in web.config at runtime....
this is the sample code .. to update connection string . but it updates the name of connection string i need to change the database name of connection string !
public static void UpdateConnection(string name, string connString) { var webConfig = new ExeConfigurationFileMap { ExeConfigFilename = GlobalSettings.FullpathToRoot + "web.config" };
i have problem white Object datasource. i have a multi-tier Application that include common layer ,DAL Layer,business logic and persantation layerwhen i add a object datasource to my page, it bring me only common layer classes . but i want use bisuiness layer classes what do i do ?
I have a label within my master page that is part of our footer. In the footer, we are wanting to display page specific information. So as you make your way around the site, the footer will contain content about that page along with other data that is universa on the entire site.I had a somewhat similar question some time back that i posted here..
http://forums.asp.net/t/1615850.aspx it was for a shopping cart of sorts..
cartct.Text = ShoppingCart.Instance.Items.Count().ToString() + " Items In Cart";
If Label is in master page, you have to use FindControl to get the Label and udpate its text
((Label)Master.FindControl("cartct")).Text=String.Format("{0} Items In Cart",ShoppingCart.Instance.Items.Count() );
once you select another page, you dont have it anymore,If you want to share data across different pages, consider using Session to save Items count.
if users press the browser's back button to reach the prior page..then page should display a message like "web page expired" in asp.net can i use javascript for this?
for example..
there are 4 pages in web sites. 1,2 and 3 can be back. but when the 4th page run then 4th page can not be back... when the user press browser's back button , diaplay ma message "weg page expired".
I have a web page (Orders.aspx) that gets some orders and show them in a Gridview .The orders list I get from DB is depend on a field named Status. The page has a master page that contains a Tab user control. The user control has several tabs and every tab has a different Status. Therefor, when the user clicks on every tab, I want to pass a value as status to my content page (Orders.aspx) and then select the orders from DB based on status.
i want to update different areas of my MVC page after one action (say a click) occurs.
how, i use ajax, and wrapping the entire area where all these parts need to be updated is counter intuitive as the ajax data being sent back would be close to the entire page.
so, i have a few partial views, - but the problem is, each action only returns one view! how can i return multiple views from this one action?
i know a popular solution is to just hammer the server with multiple async javascript ajax requests for each "part" of the view, but this really is unnecessary and inefficient, reconstructing and destroying the page (say) 5 times for just one action, when it should just occur once, and once it does, the server should manage all the partial views then and there.
no idea whats going on and cannot figure it out.I have a ASPX page, which inherits from the masterpageI have 3 div's. in each div, there is a usercontrolI can toggle the visibility just fine for the divs.problem is, (this is like a checkout process/page) when the first usercontrol has been "completed", the main page will hide that div, and make the 2nd div visible. when user completes the 2nd user control action, it should then set the visibility of the usercontrol/div to false and show the 3rd onebut this doesnt do it! it works fine for the first user control, but not the 2nd! any ideas? the code is very simple, just setting the visible property to true or false. that is all.
AJAX/Updatepanel is used on the 2nd user control for doing some async postbacks in that control but dont understand why setting the visibility of the control on the main page should affect it?Pressing the "next" button AGAIN on the 2nd user control that is showing throws a runtime exception about the nableEventValidation (invalid postback)
i have on a page a text box and a button(button1) and another set of text boxes and another button(button2). i have put a requiredfieldvalidator on all the textboxes. what i want to do is that if i click button1, only the first textbox should validate and if i click button2 then only the set of textboxes should validate. right now whether i click button1 or 2 all of the textboxes will validate. i have tried to place the first textbox and button1 in an updatepanel and the set of textboxes and button2 in another updatepanel but still its not working.
i have a usercontrol which fires a mehtod in the masterpage, the method does fire but the placeholder i want to unhide does not until i refresh the page, how can i get around this?
if (this.Page.Master is Whoops) { Whoops barMasterPage = (Whoops)this.Page.Master; barMasterPage.bindBasketSummary(); } public void bindBasketSummary() { plhLoggedIn.Visible = true; }