Edit The Current Regex Code To Include <script Type="text/javascript"?

Nov 16, 2011

Here is the current regex

"src=[""'](http://|./|/)?w+(.w+)*(/w+(.w+)?)*(/|?w*=w*(&w*=w*)*)?[""']>"

What I am trying to do is to grab element that is:

<script type="text/javascript" src="http://www.mysite="I need to grab everything inside these quotes">

With the current Regex I am able to grab the value but it also grabs all the "src" elements on the page.

src="http://www.mysite="I need to grab everything inside these quotes">

What I am attempting to do is to only get this one line that includes the

<script and then the src="">

And then just get the src="info from hrere" How can I edit the current regex code to include <script type="text/javascript"

View 1 Replies


ADVERTISEMENT

Javascript - Fill + One Year Date From Another Textbox Current Text Box

Aug 26, 2009

I have two textboxes in my vb.net code

<tr>
<td align="right">
<b>ActivationReqDT:</b>

[Code]....

I want that when I enter date in dd/mm/yyyy in first text box (ActivationReqDTTextBox), it will automatically fill the second text box (DeactivationReqDTTextBox) by adding plus one year in above entered date.

provide your solution with javascript, jquery or vb.net

View 1 Replies

Include JavaScript When Using User Controls?

Dec 4, 2011

I'm to .NET and all the associated cool stuff you can do, but am wondering about efficiency with User Controls and JS includes.

My user controls are mainly made up with an ascx display page and .vb.ascx code behind, as is customary with the code-behind coding style of .NET, which is great for coding simplicity although it does double then bear of files required. However, as I understand it, the server compiles these and returns the HTML efficiently.

Where the Control requires JavaScript, as I'm developing, I am making external JS files for each User Control with the same name, so the user controls consist of 'controlName.ascx, controlName.vb.ascx, controlName.js'

If a page requested by the user contains several User Controls the browser will be requesting multiple JS files, probably a master page JS file, jQuery AND each required file for the respective Controls.

This approach makes sense to me whilst developing and as everything's all kept nice and neat, making problem solving easy, but when it goes live there'll be loads of get requests from the browser, given that each time the browser gets a file, even the process of requesting the file to check if its cached or not must take some time.

Would I be best off including my JS inline in the ascx files, or code behind, directly inserting the script, or what is the 'correct' way to handle these multiple files to reduce get requests from the browser.

I'm using CSS sprites for buttons and stuff for the same reason, so wondering what to do with JS files. In my case CSS is generally handled by classes in the primary pages, so these are not an issue.

View 1 Replies

Include The File In Asp.net For Javascript, Css And Menus?

Jan 10, 2012

I am new to .NET. How i can use include files for my menus? I am used to do with php is I make one php file with menu and I include it in all PHP files so that it can be changed in all pages when I would change it basic file. I dont know what is the concept of it in .NET?

View 1 Replies

Edit Text With VB Code?

Jul 22, 2009

When a user clicks a button, my program checks to see if the string "Apple" exists. If it does, an "X" is added to the middle to make it "AppXle"

This is also what I want to happen:

When a user clicks a button, my program checks to see if the string "Orange" exists. If it does, the "O" and "a" are removed to make it "rnge"

View 2 Replies

Loops And Regex - Include Multi-part File Detection?

Jun 17, 2010

I have a small program that is used for managing media libraries for some software front-ends. Basically, it reads in the files of a directory and, one-by-one, creates a new directory by each file name and moves the respective file into the new folder.Everything works well, but I am wanting to extend the functionality a bit.I would like to include multi-part file detection so that titles that are named as such:

movie-disc1.avi

movie-disc2.avi

would be moved into a single folder named movie. The files would not be renamed.As of now, I simply have an option that will allow the user to ignore certain files that match a regex pattern:

Dim m As Match = Regex.Match(IO.Path.GetFileName(filePath), "(.*?)([ _.-]*(?:cd|dvd|p(?:ar)?t|dis[ck]|d)[ _.-]*[0-9]+)(.*?)(.[^.]+)$")

View 1 Replies

Asp.net - Pass Parameter As Text To JavaScript Function From .NET Code-behind

Mar 23, 2010

Basically, I have a gridview that is opened in a new window from the parent window. It has a bunch of records with a view button to view the details of each record (which stays in the same newly opened window). I have a calendar in the parent window that accepts a Date querystring parameter to set the current date on the calendar at page load. I'm just trying to refresh the calendar in the parent window to match the date of the label in the newly opened window.

All the code below is in the newly opened window. The .Net code-behind below refers to when that view button is clicked and everything is populated. At the end, I call the js to refresh the parent window and pass the value of the LabelScheduleDate as the querystring parameter. Now the label comes through as '03/25/2010' in the code-behind, but when I pass it to the js, it comes through as '0.00005970149253731343' in the end querystring. I'm not really sure what is making the value change, and I want to pass it as just text. Do I need to pass it as a string object? I tried but I don't think I was doing it right.

JavaScript Function
function RefreshParent(inputDate) {
window.opener.location = window.opener.location + "?Date=" + inputDate;
}

[Code]....

View 1 Replies

C# - Errors Translating Regex From .NET To Javascript?

May 19, 2011

I have this piece of VBNet code that i would like to translate into javascript:

Dim phone_check_pattern = "^(+?|((+?[0-9]{1,3}))|)([ 0-9.//-]|([ 0-9.//-]+))+((x|X|((e|E)(x|X)(t|T)))([ 0-9.//-]|([ 0-9.//-]+)))?$"
System.Diagnostics.Debug.WriteLine(System.Text.RegularExpressions.Regex.IsMatch("test input", phone_check_pattern))

my translated result:

var phone_check_pattern = "^(+?|((+?[0-9]{1,3}))|)([ 0-9.//-]|([ 0-9.//-]+))+((x|X|((e|E)(x|X)(t|T)))([ 0-9.//-]|([ 0-9.//-]+)))?$";
alert(new RegExp(phone_check_pattern).test("test input"))

However when i run it it has error Uncaught SyntaxError: Invalid regular expression:: Nothing to repeat

(my VbNet code doesn't have any error though)

View 3 Replies

Differences Of Special Characters In Regex: .net Vs Javascript?

May 7, 2011

I've got this implementation in javascript:

EscapeForRegex = function(input) {
var specials = ["[", "\", "^", "$", ".", "|", "?", "*", "+", "(", ")", "{", "}"]
for (var k in specials) {

[code].....

View 2 Replies

Getting ID Of A Control From Gridview Edit Mode To Be Used By Javascript?

Jun 8, 2011

Basically what needs to happen is when the user clicks edit onto the gridview and clicks on a certain textbox a javascript calendar popups up and the user picks a date.So far, I can set it statically and the calendar works for that one row, but not the other rows since the ID changes.My ASP Code (id of textbox has been set to txtStartDate):

<asp:TemplateField SortExpression="StartDate" HeaderText="Start Date">
<EditItemTemplate>
<asp:TextBox ID="txtStartDate" onClick="ddlchange()" Runat="server" Text='<%#Bind("StartDate")%>'>

[code]....

This works, for one textbox. It does not work for other since 'ct102' changes with every row.

View 1 Replies

Regex: Take Text & Some Special Characters Between The Xml Tags Using Regex On C#.net?

Feb 23, 2012

I want to take the text and some special characters between the xml tags.. My input file contains:

[Code]...

now i want the Regex to take text and the special characters between the tags <line>,<inline>..

View 2 Replies

Create A Table That Include Current Year Data And As Well As Previous Data To Be Compare

Dec 8, 2010

i want to create a table that include a current year data and as well as previous data to be compare. here is the example of the table that i want to create: but i want to compare one of the annual data with the previous year. as example i want to compare between the data of current AR of 2007 with the current AR for 2006, Current AR of 2006 with current AR for 2005 and go on~, but i have no idea how to do it.

View 1 Replies

Include A Generic Type Parameter In A Lamba Expression (2010)?

Jun 25, 2010

(Not really sure if I phrased the question correctly...) I want to create a lambda expression that would take an Object, attempt to convert it to a passed-in Type, and print to the console whether it was successful or not. At a glance, the lambda expression may seem a pretty silly way to accomplish this task, but I'd really like to know what I'm doing wrong, so I can better grow my skill set.

VS gives me a designer error about the second "T" in the expression below, telling me it isn't defined) This is where I left off:

[Code]...

View 1 Replies

Force A Commit On The Current Row From Within A Virtual Unbound DataGridView's Edit Control Event Handler?

Sep 8, 2011

Using the walkthrough from [URL], I implemented a DatagridView in virtual mode, totally unbound, in VB 10 Express (we are talking WinForms).

I understand that CommitEdit (DataGridViewDataErrorContexts.Commit) commits the current cell's contents to the data cache.

The example uses row-level commit, i.e. it pushes the values into a row buffer until the current row is left. Only then the row is added to (or updated in) the data store. That's exactly what I do, too.

Question -- how can I commit the current row programmatically without leaving it? (I want to commit the whole row, not just the current cell.)

If the user leaves the row, there is a RowValidating, RowValidated, RowEnter event sequence where the datastore update is taken care of. So one idea (currently my only one) was to simply re-set CurrentCell to Nothing, for example.

But I cannot just set the DataGridView's CurrentCell property to Nothing (or any cell outside of the current row) since I want to commit from within an event handler of a custom edit control created by a custom column, and I see an System.InvalidOperationException exception when setting CurrentCell there.

In fact, it is a tiny button right to a combo box, i.e. I create a DataGridViewComboBoxCell descendant which is a DataGridViewComboBoxColumn descendant's edit control. My special ComboBox cell adds a tiny button which should commit the current row. Unfortunately, that button's _Click event handler cannot change CurrentCell since DetachEditingControl throws the exception then.

Obviously, I must delay the CurrentCell re-assignment until the whole _Click event has been processed. Or what? How would I do that -- register a custom Windows message, SendMessage that one to me, and override the windows procedure of the form so it re-sets CurrentCell when this message is received? (Hello?)

There should be a rather easy way to let DataGridView commit all changes by firing the events that I handle to perform the datastore update, no?

View 1 Replies

Include Code With Program?

Mar 7, 2011

How can I include a Java code with VB.NET code?

View 1 Replies

Asp.net - Write/code Javascript(mouseover Event) Using C# Methods/ C# Code?

Jan 24, 2011

i am asking that can i use c# language to implement "actions" fired on "click side events" such as mouse over the reason for this stupid question is that i remember some syntax of registering functions for particular events of formview, which are call when the event occurs (yes there ispostback involved" is something like the above possible for client side events using c# or even vb.net

protected void Page_Load(object sender, EventArgs e)
{
Label3.Text = "this is label three";

[code]....

View 3 Replies

MSDN Articles Should Include VB Code?

Apr 27, 2012

With all new technologies like Async/Await I spent hours rewriting sample code from the published C# MSDN Articles to VB.NET.Now that Roslyn is available, why do the authors not inlude the VB.NET code. After all, it can be converted automatically. Why does MSFT not make this a requirement fo all published MSDN articles.This would save us VB.NETs lots of precious time.

View 6 Replies

VS 2008 Decoder - Type A Message In The "message" Text Box And It Spits Out A Code In The "code" Text Box

Dec 24, 2009

I'm making a simple decoder. Type a message in the "message" text box and it spits out a code in the "code" text box. If you pop a code into the "code" text box it spits out the message in the "message" text box. Seems simple, right? Well here's my problem. I typed "The quick brown fox jumped over the lazy dog" to test it and it will put a lowercase "f" at the beginning, put letters that aren't supposed to be in there in there, and replace what should be upper case letters with lower case. I commented out the code for replacing symbols because it seemed to work fine before I put them in the code but still the same result. I checked over the code to see if I mixed stuff up. Like I accidentally put the replacement for a lower case "e" as the replacement for a lower case "h" but I can't find anything.

CODE:

View 8 Replies

Include Code Or Files From Other Projects WITHOUT Referencing Them

Nov 16, 2011

Is there a way that I can include code or other files from other projects WITHOUT referencing them? I am trying to combine our projects into 1 EXE without DLLs. I do not want to use a self extracting EXE either. Let me know if there is a way to do it similar to the C++ #Include.

View 5 Replies

Include Dynamic Code Which Was Easy In Classic ASP

Jun 8, 2010

I've got an ASP.net file, and I'm trying to include dynamic code which was easy in classic ASP. Here is what I have tried so far:

[Code]...

View 2 Replies

.net - Edit 'bit' Data Type?

Oct 22, 2009

I am coding in Visual Basic. I am using a checkbox control. Now depending on its checked property I need to set/unset a bit column in a SQL Server database. Here's the code:

Try
conSQL.Open()
Dim cmd As New SqlCommand("update Student set send_mail = " + _

[Code].....

The send_mail attribute is of bit datatype. This code is not working.

View 5 Replies

Get Edit Control From Type?

Aug 4, 2010

I am retrieving some records from a database dynamically, not knowing exactly which table I need to query, or even which fields to retrieve. I display this data in a control that looks a bit like a listbox, except each item is two lines: a label and a value. Now, the user needs to be able to browse through this list until he finds the item he needs, and then he should be able to edit the item.

This application will (eventually, this is just a 'proof of concept') run on a mobile device or PDA or something like that, so space is limited. To allow the user to edit a value, I simply show a panel containing some edit control (textbox, checkboxes, combobox, etc), let the user edit whatever he's editing, save the change and display the list of items again.[code]...

View 11 Replies

Javascript Type Tools For Windows?

Mar 15, 2011

it may be a silly question but can anyone pls clear why windows app do not have any such tools like jquery ,javascript for increasing performance .As some time we access data from remote server and use only app interface in our machine

View 3 Replies

Edit Value Of A Registry Key Of Type REG_BINARY?

May 20, 2010

I want to edit one of the bits in the DefaultConnectionSettings key under [code]...

View 6 Replies

Get The Type Of Current Class

Sep 14, 2011

[Code]...

Take a look at the snippet above. On the third line, I'm trying to set a multidimensional array to the type that the current class is. How can I get the type of the class that I am currently in? I'm using VB.net so all .net examples are acceptable.

View 1 Replies

Edit Save Open A File Of Own Type

Apr 29, 2011

I have been using Visual Basic for about 2 weeks now so I know I am getting in over my head at this point, but times a factor. I have created a user form with around 100 User entered text boxes and pull down menus, tabbed pages etc. I can create a distributable file with no problem. However I cannot find any kind of example, tutorial, etc that will show me how to allow an end user to save the form as "enterfilenamehere.DCP" (for example) and then reopen any .dcp file created in my form application. The only examples and tutorials I can find are how to type text and save it as a txt. format. Could someone lend a complete novice some advice or point me in a good direction on where to learn about saving and opening custom file types?To clarify The user can use my form, But at this point has no way of saving and recalling what they entered in my form. It's a one time use only...not really what I want.

View 7 Replies

Use Property Grid In A Form To Edit Any Type?

Jul 22, 2009

I have an App where I'd like to be able to edit any type (font, colour, point etc.) at run time and use any of the .Net default type editors. (e.g., font/ colour picker).

Rather than re-invent the wheel, I decided to use the property grid control.

If I pass an object of, say font, to the grid, it lists all the fields separately, with no option to open the font picker.[code]...

View 1 Replies

Javascript - JSON Array Type Resolution In ASP.Net Webservices?

Jan 6, 2011

I have worked out how to pass my custom objects into ASP.Net json webservices. Works a charm. Problem I am having is passing in straight arrays of my custom objects or alternatively passing in arrays that are parameters of my custom objects. So for example...

Public Class WebService1
Inherits System.Web.Services.WebService
<WebMethod()> _

[code]....

Fails with error: The value "System.Collections.Generic.Dictionary`2[System.String,System.Object]" is not of type "WebApplication1.WebService1+Person" and cannot be used in this generic collection. Parameter name: value

So how do I explain to ASP.net that it is infact an array of Person? note: That changing the function to as List(of Person) or ArrayList does work but given that I implement my own custom collections this is not optimal for me.

UPDATE: Ok so what I have worked out so far is that this problem is definitely associated with how the JavascriptSerializer uses the SimpleTypeResolver to resolve types. Basically if I do something like this

Public Function AddPersonList(ByVal PersonList As String) As PersonList

I can recreate the error using the following code.

Dim PersonList As PersonList = jsonSerializer.Deserialize(Of PersonList)(PList)

However when I provide my own custom type resolver along the lines of

Dim jsonSerializer As New JavaScriptSerializer(New MyCustomTypeResolver)

I can successfully create an instance of my custom list.Now I have worked out how to provide my own custom convertor in the web.config file. Along the lines of this....

<system.web.extensions>
<scripting>
<webServices>

[code]....

PSS: I have tried to use the assembly fully qualified name as specified in the docs for the SimpleTypeResolver (SimpleTypeResolver MSDN) but this throws a "Operation is not valid due to the current state of the object." exception - which is an error caused when the TypeResolver cannot resolve the name?

My problem was never passing in a List(of Object) into my webservice (I simply posed the question as such to simplify it for stackoverflow). In such a case I would be willing to completely accept using a Generic List(of) but my problem was actually that one of my custom objects implemented a property with a strong typed List(of) so for example:

Customer {CustomerID AS Guid, FirstName AS String, LastName AS String, EmailAddresses AS EmailAddressList}

which now needs to be changed to

Customer {CustomerID AS Guid, FirstName AS String, LastName AS String, EmailAddresses AS List(Of EmailAddress)}

This is admittedly not the end of the world and is probably better in the webservice context (as you have suggested) but definitely a detriment when it comes to internal application usage of my Collection properties. What this means is that once I have this property I either need to cast it to my CustomCollectionList every time I want to use some advanced feature or I need to implement another property which exposes the CustomCollectionList.

View 5 Replies

Javascript - Log-in Prompt On Clicking Input Type Submit?

Jan 9, 2012

I have an asp.net page with a <input type="submit"> for a button and vb codebehind.

<input runat="server" id="review" clientidmode="Static"
type="submit" value="review" name="submit" />

What code do I add so that I get create a required log-in prompt pop-up box asking for a username and password. I also want to make sure that when the user types the password that the password field will not show the specific characters.

View 2 Replies

Getting Screenshot Include Text?

Mar 10, 2012

I have this code i have obtaned on the forums. And it seems to only take a picture of picture boxes. I have text over it that is not caught in the picture.

s = InputBox("Enter picture name.", "Name", "Name")
Dim r As Rectangle = New Rectangle(109, 22, 228, 305)
Dim img As New Bitmap(r.Width, r.Height)

[code]....

View 1 Replies







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