
andycharger
Avatar/Signature-
Posts
154 -
Joined
-
Last visited
andycharger's Achievements
Newbie (1/14)
0
Reputation
-
beez started following andycharger
-
andycharger started following PlausiblyDamp
-
Guys i have an issue... On my page, I have an embedded windows media player type thing. Its playing a live feed that is initiated when the page loads. However, I also have a rating form on the page. What I want to do is allow people to add a rating and submit that form without refreshing the entire page as the movie restarts. Is there a clever way to submit part of a page or submit a form without refreshing the page? Any help will be appreciated as always. Andy
-
I want to contain an application i am launching to a window on my form so I can send keystrokes to it. I found wscript.shell command which does indeed launch my application but It just appears freely on screen. I cannot therefore ensure the keystrokes it sends will end up in the application. Can someone tell me how I open it up contained somehow within a windows form? Many thanks andy
-
Hi guys, A couple of questions in one post. Sorry about that...... 1) Connection Strings..... When im building a windows Application in dot net, I want to add a connectionstring into my app so that I do not have to keep making the connection everytime I call it. Like when you set a connectionstring in the global.asax file in web application. Firstly, is this possible and secondly can someone provide an example? 2) Log in form. I have built one but is there a template type one somewhere. Basically, when i log in, I want to store the user_id somewhere so I can say Welcome user_id when I log in. Any help is appreciated as always. Andy
-
When I do any reference in my Page_load event to any of my page items, it says the Object reference not set to an instance of an object. The error occurs on the line you stated and I have changed the "mycheckbox.checked" to "chkOMB.checked" as that is a checkbox on my page. This is despite the fact that it is listed at the top of the VB page in "protected WithEvents" Any ideas where I initialise it?
-
Where do I initialise my controls? Is it on the Code Page or on the ASPX page? Can you provide examples?
-
Nearly! Nice try but...... When I do the code above, it says the following: Object reference not set to an instance of an object. Yes, I have changed your code to reflect my names! It seems that it does not like this during the page load. At what point can I call this in my code?
-
OK Maybe I should elaborate...... The error I am getting is thus: Server Error in '/inet1' Application. -------------------------------------------------------------------------------- Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 56: While oReader.Read Line 57: If IsDBNull(oReader("ombudsman_yesno")) Then Line 58: chkOMB.Checked = False Line 59: Else Line 60: If oReader("ombudsman_yesno") = "True" Then Source File: c:\inetpub\wwwroot\inet1\complaints\editcomplaint.aspx.vb Line: 58 Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] inet1.editcomplaint.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\inet1\complaints\editcomplaint.aspx.vb:58 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain() Basically, I am running the following IF statement on Page Load after I have set my datasource up. I know it is able to read the values when I step into the code. It just cant set the chkOMB to an item on the page even though it exists. Here is my IF statement: While oReader.Read If IsDBNull(oReader("ombudsman_yesno")) Then chkOMB.Checked = False Else If oReader("ombudsman_yesno") = "True" Then chkOMB.Checked = True Else chkOMB.Checked = False End If End If End While anyone got any ideas?
-
I have a checkbox on my screen that I need to Check or uncheck depending on what the database says. So during my page load, im querying the database and pulling back the record i need. I then check the data using an if statement that works. However, when it tries to set my Checkbox to the right condition, the page falls over. Can someone help me and tell me what im doing wrong? Here is my code: At the top of the Code page I have this: Protected WithEvents chkOMB As System.Web.UI.WebControls.CheckBox My code does the following. Dim strUser As String Dim Choices As String Dim oConn As SqlConnection Dim oComm As SqlCommand Dim strUserPerson As String Dim oReader As SqlDataReader Dim sSQL As String Dim sConn As String sSQL = "SELECT * FROM complaints where complaint_id = " & Request.QueryString("complaint_id") & "" sConn = ConfigurationSettings.AppSettings("ConnectionString") oConn = New SqlConnection(sConn) oConn.Open() oComm = New SqlCommand(sSQL, oConn) oReader = oComm.ExecuteReader() While oReader.Read If IsDBNull(oReader("ombudsman_yesno")) Then chkOMB.Checked = False Else If oReader("ombudsman_yesno") = "True" Then chkOMB.Checked = True Else chkOMB.Checked = False End If End If End While dgnews.DataSource = oReader dgnews.DataBind() oConn.Close() The aspx code on the page is as follows: <td class="normaltext" align="left" colspan="2"><asp:CheckBox id="chkOMB" runat="server" Enabled="true"></asp:CheckBox></td> can anyone help me?
-
Hi I have entries stored in my Database that are originally stored from <select> drop downs on a form. e.g. <select> <option>rice</option><option>peas</option> </select> Now when I return to the form and retrieve the information from the database and put it back on my form I use the following: <asp:TextBox Font-Bold=True CssClass="boxtext" id="txtName" Text='<%# DataBinder.Eval(Container.DataItem, "first_name") %>' runat="server"></asp:TextBox> So what I want to know is, if I have a drop down with RICE and PEAS in it, and I want to make the database recorded version the selected one when I edit the information, How do I get the option to be the Selected one?
-
submit button associated to the Return Key press?
andycharger replied to andycharger's topic in ASP.NET
OK, ive found half the problem, now I need an answer! Basically, I have 2 <ASP:BUTTON> on my web page. One is to log people out and one is to Submit the page. My problem is that my application is using the LOG OUT button as the page submit and not my SUBMIT button. How can I force my page to use the SUBMIT button by default and ignore the LOGOUT one unless it is pressed? I have tried setting the tabindex higher on the logout button but that does not help. Many thanks Andy -
I am having a problem. My users need to have the Return key associated to my submit button. Basically there are 4 textboxes on my page. When the user presses the return key I want the page to submit. Instead it goes off somewhere else. How can I force the return keypress to work the SUBMIT button? Here is my button code <asp:button id="Button1" tabIndex="0" runat="server" Text="Submit"></asp:button> It is within the <FORM></form> tags too.
-
I have a Drop down box on my page. Its not ASPX generated one, its HTML. It looks like this: <SELECT class="boxtext" name="drpReason"> <OPTION selected value=1>Select...</OPTION> <OPTION value=2>Overcharging</OPTION> <OPTION value=3>Delays</OPTION> </SELECT> Now what I want to do is when I post the page to itself set the VALUE to a variable. I can get the string from the text box by typing: strReason = Request.form("drpReason") But I want to get the Value number. When I set strReason to an Integer and try and do the following, I get an error strReason = Request.form("drpReason").value Any ideas how I do it? Andy
-
Cheers as always Plausibly! If there is a problem, I can count on you to fix! However, I had cracked it myself and was just writing a post to say I had solved it.
-
Default selection in my Databound dropdown?
andycharger replied to andycharger's topic in Windows Forms
Err....Because I did not know it existed??? But thanks cos I do now and it works a treat! Andy -
I need to pass a variable from one form to another. So when I do frm2.Show() frm1.Close() It opens a new form. However, I thought I could pass my variable from frm1 by doing this: frm2.Show(strValue1,strValue2) frm1.close But it wont let me. How can I pass the values? Using strNewValue = frm1.strValue is not acceptible because frm2 will need to be accessed from more than one form so I cant ask for frm1.strValue if, say frm3 is passing the string. Any ideas how I pass values from one form to another?