
bri189a
Avatar/Signature-
Posts
1014 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by bri189a
-
You would have to be a bit more clever: For the JavaScript: <script language = "javascript" type="text/javascript"> function openWindowWithValue(link) { if(link) { window.open(val); } } </script> HTML ASP code: <asp:DropDownList id="CustomerList" runat="server"></asp:DropDownList> I assume you can handle the bit about putting the values in the drop down list. Code Behind (c#) //Ensure you've wired up this event of coarse! private void CustomerList_PreRender(object sender, System.EventArgs e) { //You may not need the test for null, I don't remember...this just ensures you //don't wire up the javascript event twice because of ViewState if(CustomerList.Attributes["onchange"]==null || CustomerList.Attributes["onchange"]==string.Empty) { CustomerList.Attributes.Add("onchange", "openWindowWithValue('http://www.newegg.com/somepage.aspx?id=' + this.value)"); } }
-
Well a simpler way would just be to use pop 3 protocol to check the mail server yourself from your application and avoid the middle man and forgive me for being brutally honest, have a better design. Most mail servers support this well tested and long supported protocol.
-
Most people have either a ASP.NET or PHP application. There really is no reason for seperation. After re-reading your post it looks like you want a PHP web page to send the results to a ASP.NET code behind...that will never happen. The best you can get is to have a hyper link that has a query string in it that goes to an ASP.NET web page such as: <a href="someaspnetpage.aspx?id=17>Click Me</a> and then the ASP.NET web page in the page load would look at the QueryString property for "id". If you in fact had an element on the page such as: <input type=text id="txtUser"> and then the user put in a value of "asdf" you could manually get this value by doing as I said above in the code behind: Request["txtUser"] to get the value of the text box element. But there is really no reason to do it this way with asp.net since you can have the text box element be as follows: <asp:TextBox id="txtUser" runat="server"></asp:TextBox> Then when the user enters a value you can either in the txtUser_TextChanged event or anywhere in the code behind for that matter (usually in an event that is handling a form submission such as a link button) you could get the value as follows: string textValue = Me.txtUser.Text; Or if your in the txtUser_TextChanged event you could also go: string textValue = (sender as TextBox).Text; //or string textValue = ((TextBox) sender).Text; as alternative ways to get the value, the way mentioned in the first code snippet is the usual method you will see though. Nobody does what you are asking because either a) nobody mixes asp.net and php pages (it's not hard, just poor and unorthodox practice), or b) if I follow you correctly that you're trying to get a php page to post to an asp.net code behind, then it's not possible.
-
You have to if you're running your asp.net applications locally. Give that folder permission Full Access to Everyone - it should work then.
-
A lot can be gained by designing the system first instead of rushing to code. That is probably one of the biggest falicies out there. If you design your system first, in say UML and using good requirement managment techniques, then by the time you get to doing code, coding become more of a dictation of turning requirements documents and pictures (diagrams) into words and requires very little effort. Obviously this is overkill for a quick throw away app, but for anything serious it should be done, and for coding itself, the techniques mentioned above are very helpful (along with updating comments when the code changes - that gets missed a lot), but my point is, that if you design your system first, you won't have to make a lot of changes.
-
Let me know how those work for you, I currently use Posiden at home and Visio at work, both have there good and bad points (Posiden doesn't reverse engineer or build into .NET - you have to know you're UML good too) and Visio is so non-compliant that it's not worth using beyond anything basic.
-
Well it could be one of two things...the path that your trying to save to should be a directory, not a program file. The ASPNET local machine account needs read/write access to the specific directory along with the IIS account.
-
Same as classic ASP: Request[controlNameHere]
-
Look at 'Heirarchal Grid' at http://samples.infragistics.com/2005.3/
-
This should give you what you need: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sds/sds/active_directory_authentication_from_asp__net.asp
-
Yes that check is there and even put Page.Validate() before it just to hopefully get it to fire, but it never does. Think I'll do the same thing you did, handle the check in my own script.
-
You could try killing the aspnet_wp process.
-
I usually stay away from this one because I can get most to work with a regular expression validator. Anyway, what I have is a ListBox (<select>), and I want to ensure an item is selected prior to the form being submitted. It appears through my testing that the client side script doesn't fire when I submit the form unless I first select an item in the list box (which would take the point out of ensuring an item is selected). Furthermore, as a back-up I set the Server_OnValidate method to do a similiar check...it never fires, even when I expressly call Page.Validate(), or for that matter event the Validate method of the custom validator. I haven't ever seen these issues with any of the other validators, since I usually don't mess with this particular validator I figure I must be missing something. Any thoughts would be appreciated.
-
Well hopefully it will help in your problem.
-
filesTable.AcceptChanges()
-
I don't see anything glaring other than you aren't accepting the changes on your dataset or disposing your resoruces, but nothing that glares at me as something that would cause the problem. Maybe try accepting changes at the end of your custom Fill method you wrote... also trying doing an indexed loop instead of a for each and see if that is causing some sort or reference issue - shouldn't be, but I've seen stranger.
-
Boy marble... how'd you know what I was having frustrations with? :)
-
All the asp.net code is called by using the PostBack javascript function that is rendered into every page. Events are raised by a control that has had it's state changed on the client computer - this is detected through view state. All you have to do is change the value of a control on the page that is a server control (rather than an HMTL control - an example would be a <asp:Label> rather than simply a <span> tag.) Then manually call the post back method from you're script.
-
Listen, also, I wasn't trying to bash the person who wrote it, it works, it does the job, and that's what counts - it just had some coding preferences that I don't like and I just would like to see you or anyone else learn 'better' practice (mine certaintly aren't perfect), I spent the last half hour writing a TIC-TAC-TOE program for you...hopefully it will be easier to follow.TicTacToe.zip
-
'They are declaring a global variable here an initially setting it to 'X' - confusing and not good practice. Dim chrXOChar As Char = "X" 'The handles portion is saying that any of the 9 pictures boxes that are clicked will execute this procedure Private Sub XO1PictureBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles XO9PictureBox.Click, XO6PictureBox.Click, XO8PictureBox.Click, XO5PictureBox.Click, XO7PictureBox.Click, XO4PictureBox.Click, XO3PictureBox.Click, XO2PictureBox.Click, XO1PictureBox.Click 'Here they are assigning the object that was clicked into a label - which 'in itself is odd because this being called by Picture Box events...not 'great coding practice. Dim lblClicked As Label lblClicked = sender 'This is saying that if the object that was clicked doesn't have a tag 'then to exit the sub. Also it should be lblClicked.Tag not Tag() - it's 'a property not a method. If GetLblText(lblClicked.Tag()) <> Nothing Then Exit Sub 'This is calling a method called SetLblText - there is no reason to use ' the Call statement - this is old VB6 coding style, it should be removed. Call SetLblText(lblClicked.Tag(), chrXOChar) 'This is calling a function called CheckWin where the label tag is being 'passed in as an argument. The ' = True' part is not necessary if the 'function is returning Boolean. If CheckWin(lblClicked.Tag) = True Then 'The shows a message box. MessageBox.Show(chrXOChar & " Wins!") 'This exits the sub...ideally this hole block would be a part of the 'CheckWin method. Exit Sub End If 'This litle end if part is switching the current 'turn' - again with the 'the way the global variable is used and this logic it might be confusing 'to a novice. If chrXOChar = "X" Then chrXOChar = "O" Else chrXOChar = "X" End If End Sub 'This function checks for the winner but doesn't end the game. Private Function CheckWin(ByVal bindex As Byte) As Boolean 'This is setting the value of the return (incorrectly) - this is VB6 'style, and not good style at that. Ideally you would have something 'like: Dim hasWon as Boolean and a whole different flow to check for 'the winner, this isn't a very well written function. CheckWin = True 'All these if's are just look across a Grid (through the CheckGrid 'function) to see if there is a TIC-TAC-TOE win (all across, diag, etc.) If CheckGrid(1, 3, 1) = True Then Exit Function If CheckGrid(4, 6, 1) = True Then Exit Function If CheckGrid(7, 9, 1) = True Then Exit Function If CheckGrid(1, 7, 3) = True Then Exit Function If CheckGrid(2, 8, 3) = True Then Exit Function If CheckGrid(3, 9, 3) = True Then Exit Function If CheckGrid(1, 9, 4) = True Then Exit Function If CheckGrid(3, 7, 2) = True Then Exit Function 'If a win wasn't found this is setting the return (incorrectly) to 'false. CheckWin = False 'This For loop and message box are checking for a draw - horrible 'logic. Dim i As Byte For i = 1 To 9 If GetLblText(i) = Nothing Then Exit Function End If Next MessageBox.Show("Draw!") End Function 'I myself am having a hard time figuring out what the heck they are 'trying to accomplish here...Basically it appears they're checking for ' a winning pattern. Private Function CheckGrid(ByVal bfrom As Byte, ByVal bto As Byte, ByVal bstep As Byte) As Boolean Dim bctr As Byte Dim i As Byte = 0 Dim c(2) As Char For bctr = bfrom To bto Step bstep c(i) = GetLblText(bctr) i = i + 1 Next If c(0) = c(1) And c(1) = c(2) Then If c(0) <> Nothing Then CheckGrid = True End If End If End Function 'This is setting the X or the O value of the labels Private Sub SetLblText(ByVal bIndex As Byte, ByVal sText As Char) Select Case bIndex Case 1 : XO1PictureBox.Text = sText Case 2 : XO2PictureBox.Text = sText Case 3 : XO3PictureBox.Text = sText Case 4 : XO4PictureBox.Text = sText Case 5 : XO5PictureBox.Text = sText Case 6 : XO6PictureBox.Text = sText Case 7 : XO7PictureBox.Text = sText Case 8 : XO8PictureBox.Text = sText Case 9 : XO9PictureBox.Text = sText Case Else MessageBox.Show("Please contact game designers and quote error #69") End Select End Sub 'This is getting the X or O value of the labels. Private Function GetLblText(ByVal bIndex As Byte) As Char Select Case bIndex Case 1 : GetLblText = XO1PictureBox.Text Case 2 : GetLblText = XO2PictureBox.Text Case 3 : GetLblText = XO3PictureBox.Text Case 4 : GetLblText = XO4PictureBox.Text Case 5 : GetLblText = XO5PictureBox.Text Case 6 : GetLblText = XO6PictureBox.Text Case 7 : GetLblText = XO7PictureBox.Text Case 8 : GetLblText = XO8PictureBox.Text Case 9 : GetLblText = XO9PictureBox.Text Case Else MessageBox.Show("Please contact game designers and quote error #96") End Select End Function 'This sets up a new game. Private Sub NewGameMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewGameMenuItem.Click Dim i As Byte For i = 1 To 9 Step 1 'Again Call isn't necessary - it's VB6 legacy style - this is setting 'the default text of the TIC-TAC-TOE boxes. Call SetLblText(i, Nothing) Next End Sub 'Exits the program 'This exits the function Private Sub ExitMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitMenuItem.Click Me.Close() End Sub Listen, this is a poorly written program. It has a lot of legacy VB6 coding styles and poor logic. I wouldn't consider this as a good program to jump into and learn VB (or .NET) correctly. It's no wonder you're confused.
-
I'm not going away from .NET - I just need to learn Java for day job purposes...my full time job is still .NET, I'll just need to interact with Java more - believe me, I wouldn't take a step backwards! :)
-
Yeah, I've started a blog to dictate my experiances...
-
I've found in Eclipse that if you can automatically download some plugin by I also found this sun website pretty useful: http://java.sun.com/developer/onlineTraining/Programming/BasicJava1/index.html#contents Has a nice intro and most of it is just a familiarization of the differences between the two platforms. The thing that is really throwing me is they don't have properties - they have methods (which underlying in the IL is the same thing, but at the level we work with it's a little more intutive): For example in VB or C#: Public Property Text As String Get return myText End Get Set (Value As String) myText = Value End Set End Property public string Text { get { return myText; } set { myText = value; } } Is the following in Java: public string getText() { return myText; } public void setText(string value) { myText = value; } And that will just drive me absolutely nuts! A property is a property to me, not a method that I threw get or set in front of (and by the way that's just coding practice...you don't have to use 'get' or 'set' --- you could call it gText and sText. Loss of intutiveness for sure. Another thing that is fun is how events are wired up: if (btnTest == null) { btnTest = new JButton(); btnTest.setText("Click Here"); btnTest.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent e) { lblMessage.setText("Button Clicked"); } }); } That's right...you add the method and the event in the same block of code. So I guess if you have multiple objects that raise the same event you have to make an extra function and have all the event handlers call that method...lot's of extra code instead of having all the events point to the same handler. And another fun thing...once you get into doing forms...apparently they do everything in panels...can't figure out for the life of me to how to get a button to position at (20, 110) and be 100 pixels wide and 20 pixels tall.
-
Yeah... I have Eclipse...imagine Visual Studio without Forms, Web Forms, Controls, and anything else that makes development easy. Eclipse is a nice IDE if you know the libraries already, but I don't, as well as yourself, so I think your professor is being a little optimistic. Could you or I design a windows program or asp.net application without the designers, I'm assuming you can, and I know I can...is it easy or fun? Heck no! That's what the designers are for. Ask your professor what you have to download to do designer web forms and windows forms (deployment too), I'm curious what he has to say about that. My big issue is that for all the stuff out there on Java, there's not very useful (that I've found at least). No, 'hey, you're trying to do this, you need to: blah blah blah) - a forum like this, or like code project, or heck MSDN would be a start - the help files that I've seen are way to technical and don't provide an overview. I'd like to keep in contact with you about this as it seems we're both going down the same road...mine is work related, don't know about yours, but we seem to have the same goal.