Enums Via Markup In .NET?

Oct 4, 2011

I have an enum and a usercontrol, both in the same assembly (a plain .NET 4 web site). In the Constants class:public Enum CrudOperations Add Edit Delete. This controls the columns in a GridView on a UserControl via a property on the UserControl

[Code]...

In C#, I've specified the columns to show with markup as Mode="Edit,Delete", but in VB.NET, this does nothing. The only way I can get anything to show is with the codebehind, but if on the containing page I use userGrid.Mode = CrudOperations.Edit And CrudOperations.Delete, I get all the columns (there's also a delete column), but userGrid.Mode = CrudOperations.Edit Or CrudOperations.Delete shows nothing.

View 1 Replies


ADVERTISEMENT

Enums Error In Vb, How Is It Different From Enums In C#

Aug 3, 2011

I thought that enums in VB and C# where the same or at least very similar. Then today I stumbled across a bug in our VB code. The following VB code compiles and runs with no issues:

Enum Cars
Subaru
Volvo
End Enum

[code]....

Why does the VB version not catch the type mismatch? Are enum in VB and C# different?

View 2 Replies

Get The PDF Markup Along With The Text?

Mar 15, 2012

I am writing an application that has to read and interpret data stored in some PDF files. The reading part is done but I am only able to get a dump of all the words on a page and not the format of the words. What I mean is that if I have to extract a table, I am getting the numbers in the table but not the markup which defines the table.Further, there is some formatting used which displays a few of these numbers within parentheses (meaning that those numbers are negative) but the parentheses themselves are not part of the text. Hence, I am not able to distinguish between positive and negative numbers present in the PDF table!

How do you get the PDF markup along with the text? Is a PDF similar in structure to an XML with tags used to markup tables etc.? If not, then, is there a resource which describes the salient features of the PDF DOM?I am using VBA and the Acrobat library (AcroExch etc.)

View 1 Replies

.net - WPF Markup Extension Not Working?

Apr 14, 2011

I'm trying to create a VB.Net Markup Extension per this blog post but in vb.net

<Application x:Class="Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

[Code]....

View 2 Replies

ASP.NET Usercontrol Property Value Does Not Run Markup

Apr 27, 2011

Well i have a usercontrol with a property "ClientScript" and in the aspx file where i use the usercontrol i set the value to [code]the problem here is that the is litterly passed to the property and not parsed first and replaced by the ClientID..I had the same clientscript applied to a buttons OnClientClick and there it worked...Must i apply some sort of attribute to the property to get this working? [code] i know that im saving to a local variable and that it will be cleared on reload and so on but thats not the problem here.

View 1 Replies

MessageBox With Markup In Forms?

May 3, 2012

I want to show a MessageBox in a VB.NET application that has special markup for its text. More specifically, I want to display an unordered list. I tried doing it by wrapping the text in HTML tags (which Java Swing supports for example, if I'm not mistaken) and working with <ul> and <li>. This did how to do it without creating a completely custom messagebox class?

View 1 Replies

.net - Markup Page With A Bunch Of Checkboxes?

Jun 18, 2012

In my classic asp app, I have a markup page with a bunch of checkboxes. The checkbox control ID is bscv.Once a user checks a box and clicks submit, the value is processed on the next page called next.asp.Based on the value of the checked box, I display the correct dropdown.I use the following code on next.asp to display the correct dropdown.

If bsvc = "master" Then
' only master was checked
' "If the user checks only master checkbox, ...txtmaster with 2 options... is displayed."
%>
<select id="txtmaster" name="txtmaster">
<option value="">-Select a service-</option>
<option value="1">1</option>

[Code]...

View 2 Replies

Forms :: RichTextBox Markup Formatting?

Jul 29, 2009

I am trying to bind a RichTextBox to data from an XML file where text within a paragraph may be tagged with formatting tags. As an example the text may look like this:"The size of the area is 5000 m<superscript>2</superscript>".Text may also contain other formatting tags such as <bold> or <italic>:"The quick brown fox <bold>jumps</bold> over the <italic>lazy</italic> dog".

View 5 Replies

Using Markup Tags To Become Bold In Preview?

Apr 20, 2011

The way markup works for those that are unfamiliar is similar to html. For example, in HTML, <strong> is bold and </strong> closes the tag. In Markup, [b] is bold and [/b] closes the tag. Similar yet different.My form consists of 1 Richtextbox named RichTextBox1 and WebBrowser named WebBrowser1.In order to use HTML I use the following code:

Private Sub RichTextBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles RichTextBox1.TextChanged
WebBrowser1.DocumentText = RichTextBox1.Text
End Sub

View 2 Replies

Asp.net Mvc - Why Does Normal Markup Inside An @Using Html.BeginForm Need An @

Apr 19, 2012

When I make an HTML form for MVC 3/VB with the Razor engine, I would expect to be able to do it like this:

@Using Html.BeginForm("Action", "Controller")
<fieldset>
@* Other form code and values *@
</fieldset>
End Using

But if I do that I get "BC32035: Attribute specifier is not a complete statement. Use a line continuation to apply the attribute to the following statement." I need to add an @ character before the opening tag to avoid this error.

View 3 Replies

HTML Color - Markup Generator / Editor

Apr 21, 2011

With my recent new project with HTML/Markup generator/editor, I have run into a roadblock. Basically here is my code for replacing markup with HTML. The way this works is that the webbrowser has the same text as RTB1. Since the Webbrowser supports HTML, it automatically converts to the style that is specified in RTB1. [Code]

View 4 Replies

Include Dynamic Markup In Inline XML Without It Being Encoded?

Aug 13, 2009

I would like to create a HtmlHelper function for a specific kind of dropdown that appears on many pages in my app. I'm basically just trying to add some decoration around the existing DropDownList function, but it's being encoded.[code]....

but I'd rather make use of VB's inline XML. How do I get the results of DropDownList to not be encoded?

View 1 Replies

C# - How To Avoid Using Enums

Feb 15, 2010

Until asking a question on here I never considered (enums) to be a "bad thing." For those out there that consider them not to be best practice, what are some approachs/patterns for avoiding their use in code?

Edit:

public Enum SomeStatus
Approved = 1
Denied = 2
Pending =3
end Enum

View 5 Replies

Differences Between Enums In C#?

Jan 14, 2010

We have legacy character codes that we want to store as numbers in a new system. To increase readibility and general understanding in the code for devs making the migration, I want to do Enums like this..

[Code]...

With this setup, the code will be readable (imagine If Record.Status = Status.Open), and yet the values will be stored in the database as small numbers so it will be efficient. However... I am a VB.NET guy, but everybody wants to code in C#, so I need this sort of structure in C#.After Googling, I discovered the the general .NET equivalent of AscW is Convert.ToInt32("C"). When I try to use that statement in an enum, I get the compiler error "Constant Expression Required".

View 2 Replies

Using Enums With INotifyPropertyChanged?

Mar 10, 2011

I have a public property, "Status" that is an enum. I have a setter method that changes the status and raises the PropertyChanged event. However, the WinForms user interface is not properly updating. I'm pretty sure it's because Status is an enum. Although I was thinking enum was a reference type but I guess it's a value type. Does INotifyPropertyChanged work the same with reference and value types?

[Code]...

View 3 Replies

Markup Code Inside Custom Server Control?

Dec 29, 2010

I'm new to custom server controls and I'm hoping to use them to build various 'modules' for different sites I build to cut down on duplicate code.

I'm familiar with custom user controls in which I can create an .ascx & .ascx.vb file which can then be imported into an .aspx page and used freely.

However, with custom server controls I cannot find a way of using markup/html code. Is this possible at all or must all code be created programmatically?

View 1 Replies

Output Data To Text File In Asp. Markup Code?

Sep 27, 2010

I downloaded some sample code which includes a database query within the markup code. It makes a query to the database and displays the results of the web form and I would like to divert the output to a text file and I am not sure how to do this?Can this be done from here or would it just be easier to code it in the source and make a new connection to the database?

Sample code:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringIP %>"
DeleteCommand="DELETE FROM [ip-to-country] WHERE [ID] = ?" InsertCommand="INSERT INTO [ip-to-country] ([ID], [BeginingIP], [EndingIP], [TwoCountryCode], [ThreeCountryCode], [CountryName]) VALUES (?, ?, ?, ?, ?, ?)"

[code]....

View 1 Replies

Refer To StaticResource In Plain XAML? (without Markup Extension)

Jul 4, 2010

I am setting a validation rule on a series of textboxes. I'd rather not create a new instance of my custom validation rule for each TextBox.[code]

View 1 Replies

'Enums.NoticeType' Is Not Defined

Nov 25, 2008

I work for a web hosting company and was handed a VB script which I apparently have to compile with some updated settings by 1 of our clients who knows less about it than I do. But when trying to compile the code I receive an error "'Enums.NoticeType' is not defined". As expected I haven't a clue. Am I missing some of the code, or do I have to add some libraries in my Visual Basic 2008 Express Edition? I have pasted the line of code below. If requested I can provide the whole script.

Code:
Public Function UpdateNotices(ByVal intNoticeID As Integer,
ByVal strNoticeTitle As String, ByVal dtDateFrom As Date, ByVal dtDateTo
As Date, ByVal intTypeID As Enums.NoticeType, ByVal boolPrimaryItem As
Boolean, ByVal boolActive As Boolean) As Int32

View 1 Replies

.net - Using VB Interfaces, Enums, Etc In C# Code?

Oct 20, 2011

I have a solution with multiple projects, some of the projects are written in VB, some in C#. I am wondering if there's a way to use interfaces and/or enums written in VB in C# classes? My C# code below doesn't compile, however I am able to see the interface in intellisense.

[Code]...

P.S It's a console/service application, not ASP.Net (where I know it's doable).UPD: Sorry guys, was missing a reference to the project with the interface. It's fixed now. I think the thing that in VB projects references are done slightly different than in C# confused me.

View 2 Replies

Asp.net - Overloading Enums And Properties In .NET?

Sep 23, 2010

I have a base class with the the following enum and property:

[Code]...

First off, how do I do this - is it by simply overloading it? And secondly will my original property pick up the new enum automatically when using the derived class or will I need to overload that too?

View 2 Replies

C# - Iterate All Public Enums?

Nov 22, 2010

We have a common component in our source which contains all the enums (approx 300!) for a very large application.Is there any way, using either C# or VB.NET, to iterate through all of them in order to perform an action on each one?

How to iterate all "public string" properties in a .net class is almost relevant but the enums I am dealing with are a mix of types.

View 5 Replies

C# - Use Flag-based .NET Enums From Lua?

Feb 16, 2012

I'm using LuaInterface for .NET to create Windows Forms objects. This works pretty good except for one thing:I want to use the Anchor property of Control to make them resize automatically. If I only set one of the Anchors (e.g. only AnchorStyles.Top), it works, but this doesn't really make sense. I have to set more than one Anchor, which is done by combining them with "bit-wise or" (or by just adding them numerically).

In VB.Net both works:
Dim myLabel As New Label()
myLabel.Anchor = AnchorStyles.Top[code]....

which is in a sense correct as "LuaInterface treats enumeration values as fields of the corresponding enumeration typ" (says LuaInterface: Scripting the .NET CLR with Lua).It is also not possible to assign the value as a number:

myLabel.Anchor = 15 -- 15 = 8 + 4 + 2 + 1 = Top+Left+Right+Bottom

This time, the error message is rather unspecific:

LuaInterface.LuaException: function

Is there a possibility to typecast the number to the correct enumeration type in Lua?

View 1 Replies

Defining C# Enums With Descriptions

Jan 27, 2010

What would the folowing VB.NET enum definition look like in C#? [code]

View 7 Replies

Enums - .NET Enumeration Representation?

Apr 16, 2010

Is it guaranteed that the numeric values for an Enum with only uninitialized values start at zero and increment by one in the order defined?

View 2 Replies

Using Enums In Project Settings?

Mar 10, 2009

I want to add a setting that uses an enum defined in form1.vb. All the research I've done suggests support for enum type settings is built-in and handled automatically by the VS IDE ... I assume this means it's as easy as defining font or color settings. However, I'm not having much. Are any of you gurus aware of how to set up an enum setting via the Project Settings UI?

View 8 Replies

VS 2008 Get Assigned Enums With OR?

Jul 22, 2010

I realize this is probably trivial, but for some reason I'm not sure how to pull it off. Say I have the following enum:

Public Enum FlagType
Docs
Email

[Code]....

How do I then at runtime determine which flags where set for flags? In this example, it should be Docs and Email.

View 19 Replies

VS 2010 : Using Strings In Enums?

Jan 9, 2012

Is there a way to use strings in Enums like the example below:

Enum myEnum
val1 = "some string 1"
val2 = "some string 2"
val3 = "some string etc"
End Enum

It seems like you can only use integers for the underlying values.

View 13 Replies

Asp.net - Error: EntitySet 'Building' That Was Specified In Page Markup Does Not Exist On The Container

Apr 4, 2011

I've setup an ItemTeplate like so in a GridView:

<asp:TemplateField HeaderText="Building">
<ItemTemplate>
<asp:Label

[Code].....

I'm receiving the error:

EntitySet 'Building' that was specified in page markup does not exist on the Container.

There is definitely a Building entity in the pbu_housingEntities?

View 1 Replies

Trigger A Rebind Of Gridview From Javascript Or JQuery On Markup Page?

Sep 11, 2009

Is there a way to trigger a GridView rebind from an html markup page using jQuery or jscript?

I have an ActiveX download control which passes all events via jscript.

So, a have a download complete event on the markup page but not the code behind.

Here is the main aspx page:<asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server">

<script type="text/javascript" src="aurigmaiuembed.js"></script>
<script type="text/javascript">
function FileDownloader_DownloadStep(Step){
//The file list is going to be downloaded - "2 = About to Start"
if (Step == 2){

[Code]...

View 1 Replies







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