In a base class object, I have an overridable subroutine that I would like all derived objects to have the ability to include. However, they don't have to, and if it's not necessary for them to use it, I don't want them to be forced to declare it. To enforce this, I've left the default behavior empty. For example, here's my whole sub:
Protected Overridable Sub MySubroutine(ByVal someObject As Object)
End Sub
Is this bad practice? I don't want to declare it as MustOverride, but I don't want default behavior. Is there a "better" way of doing this, or is this perfectly acceptable? I don't want to be that hack programmer... just trying to learn :)
I have index.aspx , index.html and another mvc application. I found mvc application takes the priority to execute. I want to know how to determine the sequence.
When I am using one of the default validation attributes, like [Requeried], and try to submit the form that is in an invalid state some 'magical' happens and the submit is canceled. I can even click 100x that not a single server request is made.On the other hand, I can't accomplish this behavior when I am using a custom validation attribute. Although my form was in an invalid state, a request is sent to the server anyway.I took a look at the "MicrosoftAjax.js" and "MicrosoftMvcValidation.js" but I am totally noob when it comes to Javascript.How can I accomplish the same behavior for both custom and default validations
I have a code which I repeat over and over so I am thinking to write subroutine. Not sure if there are functions in C#. Could you advise how to pass arguments to it. An example of add two numbers would be great.
I am trying to create one subroutine that can handle all deletes for a web app. I have one delete popup panel in my master page, and I call it each time from my content pages. When an instance of delete is called from a content page, I store the name of a delete subroutine specific to the delete instance in a session variable and popup the delete panel in the master page. If a user types YES into a delete textbox in delete popup panel, a confirmDelete Subroutine in codebehind of the Masterpage is called. When the confirmDelete subroutine in the Masterpage is callled, I want to call a subroutine in the content page that has the name stored in the session variable. What is the simplest way to do that?
I'm trying to pass in an ID of an activity (RefNum) to my codebehind via OnDataBound called in the CheckBoxList, but can't seem to find the correct syntax.
I know I'm supposed to use parentheses when passing parameters to subroutines and methods, and I've tried a number of ways and keep receiving the following error:
BC30203: Identifier expected.
So I tried to hard-code it in the code below [ OnDataBound="FillSectorCBList("""WK.002""")" ], but it's obviously wrong. :(
I have a GridView control which is populated by an SQLDataSource. When I select a row the details are shown in a DetailsView control. Is it possible to intercept the select and run a VB subroutine at the same time so that I can make a Panel in a separate part of the page disappear?
I am not trying to activate an event or run a subroutine from a control from the masterpage, I am trying to activate or run from VB codebehind of the master page.
I have a button in a content page with a particular .click even that I want to activate from the masterpage codegehind periodically.
Also, how do I access or run a subroutine in a content page from codebehind in a master page.
I seem to be having trouble getting the btOK button (in the Modal Popup Extender panel) to trigger the btOK_Click subroutine in the code-behind for the page.
ASP
[Code]....
VB.NET
[Code]....
I have the OnOKScript set to the name of the subroutine, and have tried setting the value to "btOK_Click", "btOK_Click;" and "btOK_Click(this);" but none have worked. In a previous page I have used this to call a JavaScript function, but surely I can call the VB.NET code from here too?
I have a user control with data of person. iN this user control is subroutine which storing data to database of person.On my ASPX page I've implemented this control and another form with data which ii'm storing.On button click on ASPX page, i want to store all my data including data from my user control or subroutine in that user control which storing data of person.I want to make sqltransaction, so only one connection for aspx page and user control.ASPX.vb
[code]...
The point of my question is how to interact between my class where i have methods and user conttorl on aspx page.
I am building in error-logging into my site, and want to be able to get hold of the current page name that the error occurred in, as well as the specific subroutine or function, to then pass to a VB.NET function. Is there anyway to get hold of this information without hard-coding the names manually? For example,
Dim strCurrentPageName = ??? Dim strCurrentRoutine = ???
I've been having several doubts with how fileupload control works internally. I've been trying to implement some kind of progress bar with iframes and such but I have noticed that when a local file is selected in the fileupload control and a postbackoccurs the file content is sent to the server wheter you choose save it or not.I have tested this with some examples and postback time seems to be the same in both cases, and the only difference is the time the servers needs to write the file on disk through the "FileUpload.SaveAs()" method.
I have a test site that is using the sqlprovidermembership. It is now working as expected. one of our clients has a site that was written in PHP. They created a link to our test site and when you click on one of there menu items it places the login page in a frame on there site for instance (http://www.client.com/staff.php). Now when the user enters their username and password the validation does not work. It simply continues to bring up the login page. it does not even say that they login was unsuccessful.
when I try to change the Behavior component's id in $create() I receive an exception when running the web page with the component control on it:
Microsoft JScript runtime error: Sys.InvalidOperationException: The id property can't be set on this object.
how then to change the Behavior's id? I know it is impossible to change the id of a Sys.UI.Control component, but the web control I created has a Behavior client side API.
I am having a peculiar problem with the button when i click it i am getting script generated in source and i have some other button in my page even i have written code but now if i click them i am getting the script i dont know why
I am facing an issue. I have a web application in ASP.NET and C#. On a page I have a drop down list, which works fine in IE. However in firefox if I click on the dropdown, it get expanded, now if i type some charcter, relevant value get selected, now if i click out side the dropdown anywhere on my page, dropdown collpased, new value is shown as selected but no post back occurs. I even put a client side function to call on change of value, but that also didn't get called. However if i again click on my page post back occurs and selectedindexchanged event of that dropdown is called.
I'm doing the first bit of web-page development I've done in years, in VS2008, using VB.net. I have a fairly simple layout, which is using several nested tables. IE6 displays the layout just fine, but Firefox for some reason shows the whole thing in a small panel at the top of the page, with a scrollbar.
try to figure out what is wrong with my code but I'm lost. I've a ModalPopupExtender, triggered in code behind by the onClick event link button. The FIRST time I display my popup, it works well and if I close my popup using javascript, it works and I can get my popup back by clicking on my linkbutton again. But, if I click the "Save" button of my popup (which save data and close the popup), I can't get my popup to display again. Even if I close my popup first using javascript and then calling my server side code to save my data, the result is the same, I can't display my popup again. Seems like the postback "break" it.This popup is in an conditinal UpdatePanel and event trying to manually update the panel after the popup.show() method change nothing.Finally, I checked what server sent back to the browser using firebug and I can confirm that I received only view state information (no UpdatePanel to update), even after calling panel.Update().
the javascript is working perfectly and changes the value of the textbox.the problem happens when i submit the form - what is extracteed by the model from the textbox is the string "on", and after the submit, it also changes the value of the textbox to "on".when i load the field with a value from the model, it goes ok, and does not change