Passing A Wildcard Value As An URL?

Jan 10, 2011

My students are working on an ASP.net VB application for a Web Programming competition and we are having problems with a page where we want an URL string to return all values from our database.

Here is the page:

[URL]

If you use the jobs by category menu on the left side, if you select a job category (ie retail) it will pull up all the jobs from that category. By using a query in the URL like this:

[URL]

What we need is the URL that would show all jobs regardless of the category. I'm not sure how to do this with asp.net VB. I'm sure it's probably not all that hard, we just don't know the syntax to make it happen.

View 24 Replies


Similar Messages:

IIS Setting For Wildcard Character?

Mar 10, 2011

Is there any setting changes in IIS to support wildcard character? I am running a web application but IIS does not support wildcard character.

View 1 Replies

.NET Webforms Wildcard Route?

Sep 29, 2010

I'm using asp.net routing in a webforms app.

I would like to achieve the following url format:

http://[domain]/{parent-category}/{sub-category}/{sub-category}

where the right most category is available as a route value.

Currently I have achieved this with the following route:

routes.MapPageRoute(
"category-browse",
"{*category}",
"~/category.aspx"
);

This will pass all of the categories i.e. "trainers/running/nike-running-trainers" so I can grab the last one with a bit of string manipulation.

Is there a better way of doing this?

View 1 Replies

Finding Wildcard String Replace?

Oct 21, 2010

I am using a chat script I found for free online.

It allows a profanity filter by using string replace:

ex: ChatText.Replace("hell", "!@#$")

is there a way to do a wildcard replace? It doesn't catch the word "HELL" or "Hell" for example.

View 2 Replies

Web Forms :: Wildcard Subdomain Using 4 Routing

Mar 18, 2011

I'm using ASP.NET 4 WebForms, and can't find information about creating wildcard subdomains.

For example, url user22.example.com must point to example.com/users/user22.

May i implement this feature only with Routing (without IIS url-rewrite, or another external tools)?

View 3 Replies

Routing (in Webforms) Without Wildcard Mapping?

Jul 19, 2010

If you cannot turn on wildcard mapping for IIS (shared hosting) or can't be bothered (lazyness) can you still use ASP.Net routing if your routes end in one of the "known" asp.net extensions...like ending all routes with .ashx, .aspx etc?

From Chris Cavenagh's blog, could his examples of:

[code]...

I'm presuming so as his last route is Default.aspx, but he hasn't included any route data with that...Is there a better way? Provided this works, it looks like the best as if the application is moved or wildcard mapping can be turned on, only the routes need to change...

View 1 Replies

Wildcard Mapping For Extensionless URLs?

Apr 5, 2010

I'm working in a shared hosting environment, so my access to IIS is limited, but I need to know if I even need full access to IIS to use extension-less URLs the way I'm using them.

Basically I'm just calling a RewritePath() in the Application_BeginRequestion() method in the Global.asax.cs file... something like this:

[code]...

will this require Wildcard Mapping in IIS?

View 1 Replies

ADO.NET :: Linq And Dynamic Where Clause With Wildcard?

Mar 25, 2011

Linq add wildcard in the where clause dynamically I have a query, i.e.

var query = from r in context.company .....

then have some business logic and based on the validation I want to add dynamically a where clause

if(a == "1")

query = query.Where(r=> r.Name = Fullname); //works!!

else if(a == "2)

query = query.Where SqlMethods.Like(r=> r.Name,"%"+Fullname+"%"); //fails to compile , the r.Name is not found..

View 3 Replies

C# - How To Test Wildcard Domain Logic

Nov 28, 2010

Here is an interesting problem... I have configured wildcard domains on my production site and will be using it as a customer identifier. This allows me to display the right banner/css/logos for each customer simply be pulling out the wildcard prefix (eg. CompanyABC.website.com will be displayed the logos and branding related to CompanyABC).

But how do I test this on my local Visual Studio 2010 installation? In production the site loads COMPANY.website.com etc., but locally I can only use the flat http://localhost address.

View 3 Replies

EntityDataSource Replace * With % Wildcard On Queries?

Jan 8, 2011

I have an application that uses EntityDataSource in many places. In the EDS, I manually build the Where clause based on user input from TextBox'es.

I would like the user to be able to enter "*" (asterisks) instead of "%" when querying data.

Is there an easy as using Entity SQL or the EDS itself to do a search/replace? I know I could actually change the TextBox after the data is entered, but when the user sees his text was changed from an * to a % I don't think he will understand.

I have tried using the T-SQL Replace command and doing something like this:

<asp:EntityDataSource ID="EDSParts" runat="server"
ConnectionString="name=TTEntities" DefaultContainerName="TTEntities"
EnableFlattening="False" EntitySetName="Parts"[code]....

But I get a "Server tag is not well formed" message. I can't find an equivalent "replace" function in the Entity SQL reference....

View 2 Replies

C# - SQL To Select Rows That Match A URL With Wildcard?

Aug 4, 2010

I have a table in the db with one column containing a URL like http://site.com/users/*/profile.I am given a URL (like http://site.com/users/234/profile) and want to select all the rows in the db that match the url (in this case * is a wildcard).

I was thinking of using Regex to do this, by replacing the * with regex for any character. But am unsure as to what the SQL or LINQ code should be for the selection.

View 2 Replies

Wildcard HttpHandler Not Handling Static Files?

Jan 26, 2010

I had a look through some of the older questions, but I can't find anything.I have a Wildcard HttpHandler on my web app which is processing the url and working out if it can do anything with itIf it can't, then the StaticFile Handler should pick it up and just serve it as a static file (like an html file).The problem is, it's going through the Wildcard handler, then seemingly not going to the StaticFileHander. Is there something I need to do to the Wildcard handler, or in the web config?This is my web.config:

<add name="Wildcard" path="*" verb="*" type="Rewriter.RewriterHttpModule"
modules="IsapiModule" requireAccess="None" allowPathInfo="false"
preCondition="" responseBufferLimit="4194304" />
<add name="StaticFile" path="*.*" verb="*"
modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule"
scriptProcessor="%windir%Microsoft.NETFrameworkv2.0.50727aspnet_isapi.dll"
resourceType="File" requireAccess="Read" allowPathInfo="false" preCondition=""
responseBufferLimit="4194304" />

View 3 Replies

C# - Regular Expression To Match IP Address + Wildcard?

Jun 8, 2010

I'm trying to use a RegularexpressionValidator to match an IP address (with possible wildcards) for an IP filtering system.I'm using the following Regex:

"([0-9]{1,3}\.|\*\.){3}([0-9]{1,3}|\*){1}"

Which works fine when running it in LINQPad with Regex.Matches, but doesn't seem to work when I'm using the validator.Does anyone have a suggestion as to either a better Regex or why it would work in test but not in situ?

View 5 Replies

C# - WCF Methods Return 404 When Wildcard Mapping Is Enabled In IIS6?

Nov 5, 2010

I have a REST WCF service defined as follows:

[ServiceContract]
public interface IRest {
[OperationContract]
[WebGet(UriTemplate = "/test")]
int Test();
}

With the following web.config:

[code]....

EDIT: You can all reproduce this by creating a new WCF Service in VS2008 (new Project > WCF Service Application). Browse to the dummy method ('GetData')... you will notice it returns 400... that's fine because it shows it's still forwarding to WCF. However, if you enable wildcard mapping in IIS6 you will now get a 404, meaning WCF is no longer intercepting the request.

View 2 Replies

DataSource Controls :: Rename Columns With Wildcard Select?

Apr 9, 2010

Is there a way to do a

"select * as"

and rename all columns with some prefix, rather than having to name columns individually? Or better yet, when doing a join and getting all columns from both tables, how do you identify them uniquely in the VB where some columns have the same name?

View 5 Replies

.NET MVC2 Custom Routing With Wildcard Or Free Text Url?

Sep 28, 2010

I have a requirement to add specific functionality to an asp.net mvc2 web site to provide addtional SEO capability, as follows:

The incoming URL is plain text, perhaps a containing a sentence as follows

"http://somesite.com/welcome-to-our-web-site" or "http://somesite.com/cool things/check-out-this-awesome-video"

In the MVC pipeline, I would like to take this URL, strip off the website name, look up the remaining portion in a database table and call an appropriate controller/view based on the content of the data in the table. All controllers will simply take a single parameter bieng the unique id from the lookup table. A different controller may be used depnding on different urls, but this must be derieved from the database.

If the url cannot be resolved a 404 error needs to be provided, if the url is found but obsolete then a 302 redirect needs to be provided.Where the url is resolved it must be retained in the browser address bar.

I have had a look at the routing model, and custom routing and can't quite work out how to do it using these, as the controller would not be predefined, based on a simple route. I am also unsure of what to do to provide 404, 302 back to the headers also.Perhpas I need a custom httpmodule or similar but going there went beyond my understanding.

View 5 Replies

C# - Regex To Compare URLs With A Wildcard That Alternates Http://site.com/user/*/profile?

Jul 25, 2010

I have a user specified URL that has a wildcard in it, e.g. http://site.com/project/*/accountIn this case * could be anything, a number, a character or anything else. I want to get regex that would find a match for that. The location of the wildcard * changes and could be http://site.com/user/*/title or http://site.com/user/*/*/*/delete (just as an example, depends on the site ... so all possibilities should be supported) Then comparing that with the current URL to see if it is a match.

View 2 Replies

Passing A Value Through A Querystring?

Apr 27, 2010

Im having problems passing a value through a querystring that is split by a '&' eg :

?value=Apples & Pears

Only the "Apples" part is being picked up by response.querystring("value"). I have other values which are split by a space eg:

?value=red shoes which I can successfully extract "red shoes".

View 5 Replies

C# - What Is Passing Parameters To SQL

Jul 9, 2010

In this answer to my question of how to insert data into SQL Server he mentioned passing parameters instead of string concatenation like I currently have.

Is this really necessary for security? If so, what exactly is passing parameters? When i google it I get a lot about stored procedures. Is that what I want, I do not know about stored procedures....yet.

EDIT:

Ok, here is what I got. It seems to update the database correctly and eventually I will change the hard coded ints to inputs from a label. confirm if how I did this is not vulnerable to any sql injection or hacks.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
public partial class Stats : System.Web.UI.Page
{
public SqlDataReader DataReader;
public SqlCommand Command;
string queryString = ("INSERT INTO UserData (UserProfileID, ConfidenceLevel, LoveLevel, HappinessLevel) VALUES (@UID, @CL, @LL, @HL);");
//string queryString = ("INSERT INTO UserData (UserProfileID, ConfidenceLevel, LoveLevel, HappinessLevel) VALUES ('a051fc1b-4f51-485b-a07d-0f378528974e', 2, 2, 2);");
protected void Page_Load(object sender, EventArgs e)
{
LabelUserID.Text = Membership.GetUser().ProviderUserKey.ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
//connect to database
MySqlConnection database = new MySqlConnection();
database.CreateConn();
//create command object
Command = new SqlCommand(queryString, database.Connection);
//add parameters. used to prevent sql injection
Command.Parameters.Add("@UID", SqlDbType.UniqueIdentifier);
Command.Parameters["@UID"].Value = Membership.GetUser().ProviderUserKey;
Command.Parameters.Add("@CL", SqlDbType.Int);
Command.Parameters["@CL"].Value = 9;
Command.Parameters.Add("@LL", SqlDbType.Int);
Command.Parameters["@LL"].Value = 9;
Command.Parameters.Add("@HL", SqlDbType.Int);
Command.Parameters["@HL"].Value = 9;
Command.ExecuteNonQuery();
}
}

View 7 Replies

Passing More Then One Value With The Querystring With The Same Id?

Mar 7, 2011

I have a datalist that I want to list the Products that are comming from the Querystring. It works like this: Default.aspx/?ProductID=1
I get 1 product like I want.But I want to add more products like this Default.aspx/?ProductID=1,15,25 and get three products back. How do I make that to work?

<asp:DataList ID="DataList1" runat="server">
<ItemStyle VerticalAlign="Top" />
<ItemTemplate>
<a href="../Product/Default.aspx?ProductID=<%#Eval("ProductID") %>">
[code]...

View 1 Replies

Passing IDs Between Web Applications?

Jul 14, 2010

We have several web applications that create a shopping cart, save it to a database, then redirect to a centralized web application to process and accept payment for the shopping cart. Right now, we are using GUIDs for the shopping cart IDs and passing those GUIDs in the querystring to the payment application. We are using GUIDs so that a user cannot easily guess the shopping cart ID of another user and simply plug that ID into the URL.

Now, using GUIDs in the database is bad for indexing and using GUIDs in the URL does not truly prevent a user from accessing another cart. However, using passing integers around would make it too easy.

What is the best and most secure way to pass the IDs from the individual applications to the centralized payment application?

I know that some people may say, "Who cares if someone else wants to pay for someone else's shopping cart?" However, we have the same concern when passing IDs to the page that displays the receipt and that page includes the customer's name.

View 4 Replies

C# - Passing A 'var' Into Another Method?

Mar 28, 2010

I am probably totally missing the point here but....

How can I pass a 'var' into another method?

(I am using linq to load XML into an Enumerable list of objects).

I have differernt object types (with different fields), but the final step of my process is the same regardless of which object is being used.

XNamespace xmlns = ScehmaName;
var result = from e in XElement.Load(XMLDocumentLocation).Elements(xmlns + ElementName)
select new Object1
{
Field1 = (string)e.Element(xmlns + "field1"),
Field2 = (string)e.Element(xmlns + "field2")
};
var result2 = Enumerable.Distinct(result);

This code will vary for the different type of XML files that will be processed. But I then want to iterate though the code to check for various issues:

foreach (var w in result2)
{
if (w.CheckIT())
{
//do something
}
}

What I would love is the final step to be in a method in the base class, and I can pass the 'var' varible into it from each child class.

View 3 Replies

Passing An ID Between Pages?

Feb 22, 2011

I have a Default.aspx page in which I have bind a Grid. In the Grid is a button named Details.

I also have a Details.aspx which has a GridView. If I click the button that exist in Default.aspx, there appears an Details.aspx page which appears empty.

When click the Detail button of a specific row, there appears the details of that button clicked. I am not understanding on how to pass the ID to Details.aspx.

Details.aspx

<asp:GridView ID="DetailsGridView" runat="server" BackColor="White" AutoGenerateColumns="false"
BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="ID"
ForeColor="Black" GridLines="Vertical">
<FooterStyle BackColor="#CCCC99" />

[Code]....

View 2 Replies

MVC :: Passing Id In Parameter?

Aug 26, 2010

I am using url in my mvc application like /product/edit/5, should change it because users can

change id parameter and access different product as this Id directly refer to Id in product table, I have validation there for user to access product.

should I continue with it or should I change it as application has many users

View 2 Replies

C# - Passing Through A Datagrid Value?

Dec 26, 2010

I have a datagrid with 2 columns.

One databound which display names and the other one is a hyperlink column.

Column1 = databound column, Column2 = hyperlink column.

column1: column2:
---------------------
Name1 Modify
Name2 Modify

Next when i click on any of the values in Column2 i simply get redirected to a other page.

This page contains 2 buttons/hyperlinks with Yes or No. (does not mather wich control, which one would bring the most easy to implement solution atm)

When clicked on No it simply redirects back to the orignal page.

Now the question is when i press "Yes" how exactly do i acces "Name1" (or Name2 if i press on the second modify)?

Meaning if i press Yes i want to use this Name for certain opertions (xml).

To put it short if i press on "modify" i want to be able to get that name associated with it (which is already displayed in the first bound column left of it).

So the goal is to use that name in Xpath for example so i can make a query towards that node with that certain name.

View 2 Replies







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