C# - MVC URL.RouteUrl Removes RouteValues But URL.Action Preserves Them?

Oct 17, 2011

Lets say we have this route:

routes.MapRoute(
"Library",
"Lib/{id}/{lang}",
New With {.controller = "MyLibrary", .action = "ShowItem", .id= 0, .lang = "en"}
)

[Code]...

View 3 Replies


ADVERTISEMENT

Custom Action, Uninstallation Removes Added Registry Key?

Sep 12, 2009

I've made a small program that creates a registry item in the users run key (basically starts the program on bootup), my question is does anybody know how to remove the item from all the users of the computer when the program is uninstalled?.

I know that all the other users registry hives aren't loaded at anyone time and feel a custom action dll that runs on uninstall that iterates through the 'documents and settings' folder loading the hives one at a time and removes the registry key.

View 3 Replies

.net - Silverlight Datacontext, Repeats All The Past Commands/action Each Time A New Action Is Performed On It

Mar 28, 2011

a datacontext defined in a module(domain services ado.net ria)a page having add/delete methods whenever any method is executed, it is found that all the previous actions (NEW RECORD ADDITION and DELETION OF RECORDS) are carried out before the new action is carried out normally

this behaviour is not prominent but "when using break points and inspecting the values of the variables and table object to be added to context, it is clear that all the previous actions take place again. even when the datacotext. savechanges is called, even after that still all actions carried out on the datacontext repeat themseleves, when any new action is to be carried out

View 1 Replies

Creating A Child Class Of XElement That Still Keeps A Reference To Original XElement And Preserves Tree Structure

Dec 20, 2010

I'm working with a class that inherits the XElement class.The new class is called MXElement.It adds some new functionality to it for navigating through the XML tree, as well as some more information regarding attributes, but that's not particularly important.My problem is that I have an XML Tree filled with XElement objects.However, when I create a new MXElement object from the XElement object before, it is just a copy of that object. This means that any changes that I make to this object will not effect the original tree.I suppose what I'm asking for is a way to build in the functionality for my MXElement class and keep references to the original XElement objects.If possible, I would really prefer to keep MXElement a child class instead of building a lot of extension methods for XElement.

View 1 Replies

Use A Single RouteURL To Route To Different Pages Dependent On The Route Name?

Mar 22, 2012

I am trying to use a single RouteURL to route to different pages dependent on the Route name but when I click on a button within my aspx page the page gets routed back to itself:Here is what I have in my Global.asax

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application startup
RegisterRoutes(RouteTable.Routes)[code].....

View 1 Replies

.net - EF - Only Removes Relation When Hit By Breakpoint?

Jun 7, 2012

<HttpPost()>
Function Edit(<Bind(Prefix:="Article")> ByVal Article As FormCollection, Optional ByVal DepartementID As Integer = 0, Optional ByVal LeverancierID As Integer = 0) As ActionResult ', ByVal ReferenceSupplierID As Integer
' Dim Art As Article = ArticleService.GetArticleById(Article.ArticleID)
Dim _toUpdateArt As Article = ArticleService.GetArticleById(Article(0))
UpdateModel(_toUpdateArt, Article)

[Code]...

toUpdateArt.Departement = Nothing and _toUpdateArt.Supplier = Nothing is to remove the optional relationship.But it only works when i debug it and sometimes after several loops of the command, before the relation is actually removed and it's stored in the database.When there isn't a breakpoint on the "function", the Relationship will never be nulled.Does anyone has an explanation for this and how to fix this?

View 1 Replies

Icon To Bitmap Removes Transparency

Oct 23, 2009

I have a system icon (for example a folder icon) and I want to display it in a richtextbox. That's not a problem, but the transparency of the icon is gone and is replaced by a blue color. I tried to use the MakeTranparent function of the bitmap object, but with no luck. How can I make the bitmap transparent again?

Here is my code:

Dim _mycurrentFolder As String = "C:Test"
Dim _folderIcon As Icon = GetSystemIcon(_mycurrentFolder)
Dim _folderBitmap As Bitmap = _folderIcon.ToBitmap()

[Code]....

View 12 Replies

IDE :: Creating A Foreign Key Removes The Relationship

Mar 25, 2009

I think this is an IDE problem, but may be my lack of understanding, so apologies if I am wrong.I have an SQL database, VS2005 app working fine, but if I put a foreign key constraint on the relation between 2 tables, as soon as I try to access the table it throws an exception as shown below. Exception.InnerException for details. The error is: DataMember property 'tblProduct_tblStock' cannot be found on the DataSource.If I delete the foreign key constraint it works perfectly happily. I am at a loss since the error seems to be one that I would expect at compile rather than run, and anyway does not seem to be true since the relationship is clearly there in the DataSource (otherwise I wouldn't be able to edit it to remove the constraint!) Possibly I am doing something stupid, but the exception is confusing me too much to let me see it. All I am trying to do is ensure that I can't create a stock record without the product existing, without coding a check - which I thought was a straightforward SQL approach

View 1 Replies

DataGridView Sorting Removes Cell Formatting?

Apr 27, 2011

I have created a winform which is having a DataGridView control, based on some condition i am coloring few cells in red color.

' Array MismatchRecords is containing rows and column no. of each cell needs to be colored
For y = 0 To UBound(MismatchRecords)
Dim Row = CInt(Split(MismatchRecords(y), "|")(0))

[code]....

View 2 Replies

Split Removes Tabs/spaces In String?

Jun 16, 2009

i am trying to split a string up into separate lines with the following code, but for some reason it is also removing the spaces in the string.

Dim calculationText As String
calculationText = File.ReadAllText(fileName)
Dim fields() As String
fields = calculationText.Split(vbCrLf)

when i am in debugger mode, i look at fields, and every element has a line of the string but all the spaces and tabs are removed.

View 3 Replies

.net - Masked Text Box Removes Preceeding Zeros In Date?

Jan 8, 2010

I have a process which grabs the birthdate and from a data table and display them in a masked text box for viewing and editing However when pushing the data into the textbox any preceding zeros get removed For example 05/05/2005 would display as 55/20/05__

The masked Text box is set up as 00/00/0000 The line which assigns the code is:

MaskedTextBox.Text = Format(DataTable(0)("DOB"), "MM/dd/yyyy").ToString

To date I have tried the following:

[Code]...

View 2 Replies

App That Downloads Web Page And Using Regex Removes A Tag But Text Changes From 'Macy'

Jan 9, 2009

An have an app that downloads a web page and using regex removes a tag, but the text changes from "Macy" to ?Macy?, [code]

View 1 Replies

Asp.net - HTML Agility Pack Removes Break Tag Close?

Apr 5, 2011

I am creating an HTML document using HTML agility pack. I load a template file then append content to it. All of this works, but when I view the output file it has removed the closing tag from my <br/> tags to look like this <br>. What is causing this?

Dim doc As New HtmlDocument()
doc.Load(Server.MapPath("Template.htm"))
Dim title As HtmlNode = doc.DocumentNode.SelectSingleNode("//title")

[code]....

I ended up just reading in my template file as a standard string then loading the html like this

Dim TemplateHTML As String = File.ReadAllText(Server.MapPath("Template.htm"))
TemplateHTML = TemplateHTML.Insert(TemplateHTML.IndexOf("<div id=""topContent"">") + "<div id=""topContent"">".Length, _
html.ToString)
doc.LoadHtml(TemplateHTML)

View 2 Replies

VS 2008 - Saving File Path To MySQL Removes Slashes

Sep 24, 2009

I am able to browse to a file and save its path in a textbox, but the slashes from path are removed when saved to the database.
C:Program FilesApplicationDocStudio.bmp
becomes
C:Program FilesApplicationDocStudio.bmp
Public Class FormSettings
Dim Result As String
[Code] .....

View 2 Replies

VS 2010 - Clicks The Remove Button, It Removes Random Items, Not The Selected One?

Mar 28, 2010

I have a listbox were users can add items to. Then i also have a remove button which removes the selected item. The listbox also has a datasource, so to remove an item i uses this

[code]...

But i also want sorting on the listbox. But when i clicks the remove button, it removes random items, not the selected one. How can i fix this?

View 7 Replies

.net - Exporting To Excel Removes Leading Zeros. Css Styles To The Table Does Not Carry Over To The Excel Export?

Aug 4, 2011

I have an asp:table which I want to exported to excel. One of my fields are alpha numeric and when exported to excel the leading 0s are stripped off. After going through this thread: Validation (CSS 2.0): 'mso-number-format' is not a known CSS property name I would like to use the css method "mso-number-format:@;.But the css is not exported to excel. I just tried to test it with simpler css things like bold font etc but its not getting carried over. I can see that if I surround my asp:Label with tags this change gets carried over to the excel but not the css bold . Other solutions in other thread does not work for me as ="00111" shows up as desired in excel but in the web form it shows up as ="00111" which is not what i want.

View 2 Replies

Opens A Text File - Removes Characters And Then Saves The File

Apr 7, 2010

i'm new to vb and am making a program that opens a text file, removes characters and then saves the file. so far i have the following

[Code]...

View 1 Replies

.net Doing Action For Other Forms?

Feb 23, 2010

I have 2 forms, 1 is for control and the other is for display. Its 2 because the 1 for display will consume the whole screen and there's no space for buttons.Im trying to control form4 using form2 or some other form, navigating a certain webpage in the process.

I have this code for the control: but it does not work, what would I do?[URL]..

View 1 Replies

Cancel An ASP.NET MVC Action?

May 12, 2009

This should be simple, but the answer is eluding me. If I've got a Save action in my controller, and the save fails, how do I cancel the action without disturbing what the user entered? For example, Index is strongly-typed of "MyTable":

Function Index() As ActionResult
ViewData("message") = "Hello"
Return View(New MyTable)

[Code]....

In the Catch, if I put Return View(form), I lose the message passed via ViewData. If I redirect to Index, I'll lose what the user entered. I think I've seen the simple (correct) way to handle this before, but if you don't know what to search for, it's hard to find.

View 3 Replies

Put Your Updates Into Action?

Sep 30, 2009

I know there are several ways to publish updates but I would like to know the best way to do it. What I already have configured is a shard network folder which I intend to have the program update from there. What would the best way to publish updates to the folder be?

View 1 Replies

Redo An Action In Vb During 'IF'?

Nov 19, 2011

If my if is not correct, and it goes in the 'then', how is it possible to redo my whole sub? I want to automate a whole sub.

View 1 Replies

.net - Action(Of T) In VB In List(Of T).ForEach?

May 21, 2009

I have searched high and low for documentation on how to use this feature. While the loop I could write would be simple and take no time, I really would like to learn how to use this. Basically I have a class, say, Widget, with a Save() sub that returns nothing. So:

Dim w as New Widget()
w.Save()

basically saves the widget. Now let's say I have a generic collection List(Of Widget) name widgetList(Of Widget) and I want to run a Save() on each item in that list. It says I can do a

widgetList.ForEach([enter Action(Of T) here])

....but how in the F does this work??? There is no documentation anywhere on the intrablags.

View 5 Replies

.net - Ambiguous Action Methods - ASP.net MVC?

Jul 16, 2009

I am having trouble doing something that is probably pretty simple!I have a stock listing that is done by 1) a simple form with parameters (Index) and 2) an ajax called partial view that displays the list of stock (based on the params).On this same simple form (Index) I have an action link to an "Add Stock" method which calls another form for adding stock.When the user has finished adding the stock I redirect them back to the stock list page (Index).

My issue is that I would like to "remember" the parameters that were initially entered in this form so the user isn't just directed back to a page with blank parameters forcing them to enter them again.I thought I could simply overload the Index method as such:

[Code]...

I get this error: The current request for action 'Index' on controller type 'StockController' is ambiguous between the following action methods:.Now I have read this post and it's answer but I cannot figure out how to implement the solution. Is this solution applicable in my situation? Is there a better way to acheive what I'm trying to do?

View 2 Replies

Apply Action To Every Tabpage?

Mar 19, 2010

I have this action will fire on the painting of a tab page.

Private Sub TabPage1_Paint( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs) _
Handles TabPage1.Paint

[Code]...

View 5 Replies

Bind Action To Button?

Feb 15, 2011

I want to make a form that makes a button when loaded. How can I make this button work (meaning that something happens when button is clicked)?[code]...

View 2 Replies

C# - Execute Photoshop Action From VB UI?

Jun 9, 2012

I am trying to run photoshop action from VB interface. can any body guide me on how should i proceed.

View 2 Replies

Close A Program Action

Mar 6, 2009

In my work, we have a program done by other company, and we don't have the code to change it. This program register a serie of numbers and then if the user whants, save them to an xml file. But if the user forget to save and close the program, it doens't ask if whant to save the data, it simply close and all data is lost. I whant to know if its possible to build a vb.net application that controls when the close button is press and freeze the program or something to remind the user to save the data.

View 3 Replies

Delete A Folder And Than Do An Action?

Mar 9, 2010

I would like my program to delete a folder. (in this case an old backup so that we can make a new one with ease) but I need my application to Wait till the folder has been deleted. How do i do this?

View 4 Replies

Dropdownlist Onchange Action

Jan 24, 2012

In my view there is this DropDownList:

@Html.DropDownList("fOrderstatus", TryCast( ViewBag.StatusOptions, SelectList), "--pick--", New With { .title="Pick an orderstatus"} )

The view shows purchaseorders and the dropdownlist should give the user the possibility to filter, e.g. choosing only 'active' orders.

I prefer a solution in plain vanilla ASP.NET MVC.

In old skool ASP classic I would have an onchange=submit in the SELECT and in the called ASP (via the FORM action) a Request.Form([name of the SELECT])...

View 1 Replies

Enabling A Button With An Action?

Jun 30, 2010

I am building an application that has a few elements to it but one of the first elements is that when a user selects a date, they have to hit a button in a message box that confirms the date that they selected and then it enables another button. The code is written as such:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startDateButton.Click
Dim buttondialogresult As String
Dim confirmbox As DialogResult

[code]....

But when I select ok from the Windows.Forms.DialogResult.Ok, it is not enablind the exceptionsButton.

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved