Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all 3509 articles
Browse latest View live

Question On WebParts

$
0
0

Hi.  I'm trying to make a change to an existing web application.  I have a fair handle on C#, but my knowledge of jscript and asp is minimal, so please forgive the ignorance.  :)

I have a webpart that is a checkbox.  On the menu bar I see "minimize, close, edit and connect".

From my research so far, I guess these are called verbs?  Anyway, in a specific condition, I don't want the zoneeditor to show up for a specific field.  So I searched and found code where I added the if statement:

CurrentWebPart.AllowClose = false;
CurrentWebPart.AllowMinimize = false;

if (somecondition)
  CurrentWebPart.AllowEdit = false;

The way this was treated was an empty ZoneEditor.  What I want is to intercept the event and not show anything when the condition has been met.  Basically, when the "Edit" verb is clicked I want it to fall thru and act like it wasn't clicked on.  I figure if I find the event, I could put some code like "if (condition) then exit".  How do I locate the C# or jscript event that's triggered by clicking the edit verb? 


Why does LocalHost in VS 2012 not work for one of my ASP.NET websites?

$
0
0

I have a fairly big ASP.NET 3.5 website (using a SQL Server database) that refuses to open any page via the 'View in Browser' option of VS 2010 Pro or VS 2012 Pro, i.e. the LocalHost facility does not work for this site. All I get is a 'File Not Found' error.

This prevents me from using many of the debugging facilities of Visual Studio, which is very frustrating. Two other ASP.NET 4.0 sites (which are much simpler and do not have any SQL Server connections) can be viewed without any problem via the LocalHost service.

I suspect that the web.config file may be the source of my problem but would really appreciate some diagnostic guidance.

David

BTW, I posted a similar question a long time ago but got no useful answers. I'm hoping for a more positive response this time!

Help with viewing binary image in sql DB with ASP.net

$
0
0

Hi,

I am getting the following exception:

Server Error in '/' Application.


Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS1061: 'ASP.new_page_aspx' does not contain a definition for 'DataList1_SelectedIndexChanged' and no extension method 'DataList1_SelectedIndexChanged' accepting a first argument of type 'ASP.new_page_aspx' could be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 3:  <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
Line 4:  Line 5: <asp:DataList ID="DataList1" runat="server" RepeatColumns="3" Line 6:          RepeatDirections="Horizontal" Width="100%" BorderColor="#336699" 
Line 7:          BorderStyle="Solid" BorderWidth="2px" 


Source File: c:\Users\jformento\Documents\Visual Studio 2010\Projects\TestFileUpload\TestFileUpload\New Page.aspx    Line: 5 




Here is my Asp.net code:


<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="New Page.aspx.cs" Inherits="TestFileUpload.New_Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<asp:DataList ID="DataList1" runat="server" RepeatColumns="3"
RepeatDirections="Horizontal" Width="100%" BorderColor="#336699"
BorderStyle="Solid" BorderWidth="2px"
onselectedindexchanged="DataList1_SelectedIndexChanged">


<ItemTemplate>
<asp:label ID="Label1" runat="server" Text='<%# Eval ("ProductName") %>' Font-Bold="true" Font-Size="10pt" ForeColor="336699" Width="100%" />
<br />
<asp:Image ID="Image1" runat="server" ImageUrl='<%# "GetImage.aspx?id=" + Eval("ProductID") %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
</asp:DataList>


</asp:Content>

Here is my c# code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace TestFileUpload
{
public partial class New_Page : System.Web.UI.Page
{

protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)


{

if (!Page.IsPostBack)
{
string constr = "Server=SampleServer; Database=SampleDB; uid=test; pwd=test";
string query = "SELECT ProductID, ProductName FROM Products";

SqlDataAdapter da = new SqlDataAdapter(query, constr);
DataTable table = new DataTable();

da.Fill(table);
DataList1.DataSource = table;
DataList1.DataBind();
}



}
protected void Page_Load(object sender, EventArgs e)
{
string id = Request.QueryString["id"];

string constr = "Data Source=.\\SQLEXPRESS; Database=MedIns; uid=jformento; pwd=bluesky";
string query = "SELECT ProductImage FROM Products WHERE ProductID = @ProductID";

SqlConnection con = new SqlConnection(constr);
SqlCommand com = new SqlCommand(query, con);

com.Parameters.Add("@ProductName", SqlDbType.Int).Value = Int32.Parse(id);

con.Open();
SqlDataReader r = com.ExecuteReader();

if (r.Read())
{
byte[] imgData = (byte[])r["ProductImage"];
Response.BinaryWrite(imgData);
}
con.Close();
}




}
}

Any help would be great!

Thanks


Visual studio 2012 very slow

$
0
0

OMG my VS2k12 is very slow. 

Is there any way to fix that?

Is it the final version already?

thx

ANderson

How to swtich over to source part of design page from .vb code file

$
0
0

I am working on visual studio 2008.  When i right click on .vb page and choose view designer, it switches to design mode of design page. But i need it to switch to source mode of design page where i can see the desgin code. I am unable to find the settings for this. Please help

Visual Studio 2010: Live Site Bin referencing local machine version....

$
0
0

I am certain I have a reference set incorrectly somewhere. My local machine version runs a Visual Studio 2010 Project using an Access Database and SQL Server 2008 EXPRESS R2 version. Everything works locally- just great. Super duper. no problems. 

I have deployment package settings set to 3.5 because my web host provider is behind the times and runs 2.0. with SQL server 2005.

When I copy the local machine version's bin to the web host provider (live site). The pages work for about 3 or 4 click throughs. At which point I throw an acception on the Access database connection string that references a file on my LOCAL machine.

So far, I have cleaned my local solution. Deleted any files that contain a reference to my local machine....most all of which were in the bin.

I suspect, that the DLL is running scripts that are writing the local machine reference...but I sure can't find them.

Any help?

Please help!

 

VWD 2012 Express for Web database designer

$
0
0

May be I am missing something here but when I first installed VWD 2012 Express I was able to create and edit databases (add tables, modify columns, add stored procedures etc) but now, no matter which of my projects I go to, I no longer have the ability to edit the database structure.

Within the Database Explorer view of VWD, when I open my database and right click on "Tables" the only menu options I have are "Refresh" and "Properties", "add table" has gone. When I right click on an existing table, once again the usual set of menu options is reduced to "Copy, Refresh and Properties"

If I right click on Data Connections, the option "Create New SQL Server Database" is greyed out.

Looking at the event logs on my computer, I see a pair of errors in the system log whenever I first connect to my database, and those errors are:

1) The following fatal alert was generated:48. Ther internal state is 552

2) The certificate received from the remote server was issued by an untrusted certificate authority. Because of this, none of the data contained in the certificate can be validated. The SSL connection request has failed.

The puzzling this is, I dont recall changning anything on my computer, one day it worked, the next it didn't. The default installation of SQLEXPRESS on my local PC has the "Force Encryption" option set to "No"

Any suggestions as to what is going on?

Online Reservation

$
0
0

Hi , 

Can please any one help me or give me a tutorial for Online Reservation system using ASP.NET C# . 

Thanks


VS2012 Website compile: Value of type 'System.Web.UI.HtmlControls.HtmlGenericControl' cannot be converted to 'System.Web.UI.HtmlControls.HtmlTableRow'.

$
0
0

I've just upgraded to VS2012 and I'm getting the following error on a website project that compiles and runs without error in VS2010:

Value of type 'System.Web.UI.HtmlControls.HtmlGenericControl' cannot be converted to 'System.Web.UI.HtmlControls.HtmlTableRow'.

The file the error specifies is an ascx file (web user control) and the line in question is:

<tablewidth="100%"id="tblTitle"runat="server"><thead><tr><th><asp:PlaceHolderID="phTitle"runat="server"></asp:PlaceHolder></th><thid="cellRSS"runat="server"visible="false"style="width:36px;"><asp:HyperlinkID="linkRSS"runat="server"NavigateUrl="/rss/rss.aspx"><imgsrc="/images/utility/xml.gif"border="0"alt=""/></asp:Hyperlink></th></tr></thead></table>

Anyone have ANY idea what the bleep VS2012 is talking about?  I don't see a generic control where a table row should be.

BTW, does anyone else think VS2012 is BUTT UGLY!?

TIA,

Option for connecting to Access DB with Password.

$
0
0

Hi All,

I am using Visual Web Developer Express 2010. It is running on Server 2003 with ASP 4.

As I add my gridview and choose my datasource (which is a password protected mdb file) it connects just fine. It does ask me for the password twice through out the process. I enter it and I do perform the test query option and all seems fine.

However, once I test the page in the browser I receive a rude error page stating: "[OleDbException (0x80040e4d): Not a valid password.]"

I am guessing that the password I entered during the setup of the datasource is not being saved. How do I enter in the password so the form keeps it? Web.config or code? I have went crossed eyed searching for this with VWD Express.

Any help would be great.

Thank you.

Fixing Visual Studio

$
0
0

Can someone please tell me how to stop visual studio 2012 from messing with my code? Every time I try to edit CSS I need to comment out some lines to test things. Every time I type /* in the css document visual studio incorrectly enters /**/ instead, so then when I go to the end of the line and enter */ I get an error message because it no longer understands the line

/**/ margin-left: 15px */

I've even had visual studio crash once on me while this happened. It's very annoying, and end up having to delete the second */ every single time I enter /* and after doing that for 8 hours a day I'm ready to punch someone.

I type /* I do not want it to put /**/ into the code it messes everything up.

Format the whole document is not working in 2012

$
0
0

The "Format the whole document" feature is not working in Visual Studio 2012 Ultimate.  Can anyone tell me how to fix that?

Thank you in advance.

David

Need advice on linking projects

$
0
0

Hi,

I have a project that I use for all data management related functions. I've linked this project to an MVC app I've built so that I can keep the data related functions separate from the MVC app.

I now want to use the same functionality in a third app -- also an MVC app. Do I go ahead and add that project to the new project's solution? What is the best way to handle this scenario where I have a data management project and I want to use the DLL it generates in multiple MVC apps.

"Value does not fall within the expected range"

$
0
0

Hey all,

When I try to open the web.config from within visual studio I get the following popup error:

"Value does not fall within the expected range"

Other files open just fine and the project compiles and runs. I've tried rebooting, I've tried uninstalling and reinstalling. I've tried deleting Temp ASP.NET directories. So far nothing has worked. I went to another project and I got the same error so it doesn't seem to be project specific.

I was running the Visual Studio 11 Beta and the error then said something about parameter was incorrect. I uninstalled and installed Visual Studio 2012 Express for Web. Same issue but different error message.

Any ideas?

VS2012 Help

$
0
0

I recently installed windows 7, so I decided to update to VS2012 express, I think I made a mistake or the installation and upgrade should come with some instructions.

1. I can't get fonts and colors to customize

2. I can't get my updated database to work properly - will not open design surface, will not open my stored procedures, will not save/update the database when I change tables or relationships. Asks me to save a separate file and then when I reopen nothing has changed. Queries that worked before stop working.

3. Membership and Roles do not work

The fonts and colors while being a nuissance, I can live without, but I can't live without the data in my database.

What happened to the asp.net configuration tool that helps setup roles/permissions etc????

What server are they using to display on your machine? IIS????

Is there a way to display on your machine without debugging???

Is there any info, help, tutorial on migrating to VS2012 from 2010???


where is Manage Styles window in Visual Studio 2012

$
0
0

where is Manage Styles window in Visual Studio 2012

VS2010 web browser

$
0
0

Just curious; is there a way of setting the VS test browser to always use a static port number (xxxxx below) so that test pages can be bookmarked?

http://localhost:xxxxx

 

Visual Studio 2010 Debugging issue with Symbols, Can't find Conversions.vb file

$
0
0

Hello,

I loaded all Symbols and it giving me following error. By the way there is no f drive. I did configured to local drive C :\symbols.

It was not able to download Conversions.vb file. thanks for your help

Locating source for 'f:\dd\vb\runtime\msvbalib\Helpers\Conversions.vb'. (No checksum.)
The file 'f:\dd\vb\runtime\msvbalib\Helpers\Conversions.vb' does not exist.
Looking in script documents for 'f:\dd\vb\runtime\msvbalib\Helpers\Conversions.vb'...
Looking in the projects for 'f:\dd\vb\runtime\msvbalib\Helpers\Conversions.vb'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
Looking for source using source server...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: f:\dd\vb\runtime\msvbalib\Helpers\Conversions.vb.
The debugger could not locate the source file 'f:\dd\vb\runtime\msvbalib\Helpers\Conversions.vb'.

Can an application (a part of a website) be published using Web Deploy

$
0
0

Suppose website www.mydomain.com has an application myapp (i.e. www.mydomain.com/myapp), can myapp be published using Web Deploy?

I cannot figure out how to configure the publish profile for this, or it is impossible.  I have tried the following:

Publish method: Web Deploy

service URL: www.mydomain.com

Site/application /myapp

and got the following error:

Error 1 Web deployment task failed. (Site 'myapp' does not exist.) 

Any tip will be greatly appreciated.

 

Bundling not working when deployed to web host, works fine locally

$
0
0

I need some pointers on how to diagnose this problem. I've got bundling and minification working just great on my local project, but when I copy the changes up to my web host, I just get a bunch of 404 errors trying to load those bundles. Both sites are running identical code - one bundles fine, the other doesn't.

I have a BundleConfigs.cs in my App_Code directory that has for example:

bundles.Add(new ScriptBundle("~/bundles/default").Include("~/default.js"));

Along with a few bundles.Add loading jquery etc. from the microsoft CDN.

I have a bundle.config for all my css files, with a styleBundle like:

<styleBundle path="~/Content/css"><include path="~/Content/normalize.css" /><include path="~/Content/main.css" /><include path="~/Content/Site.css" /></styleBundle>

In my global.aspx:

void Application_Start(object sender, EventArgs e)
    {
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }

In my site.master file in the <head>:

<webopt:BundleReference runat="server" Path="~/Content/css" />

In my default.aspx, I have a few Scripts.Render calls to load jquery etc. For example:

<%: Scripts.Render("~/bundles/default") %>

among others for jquery etc.

So everything seems correct (hopefully, this is my first time getting this to work) and in fact it DOES work like a charm on my local machine. I can turn debug off and notice on the Net panel in Firebug that it is most definitely not loading all the individual css/js files but only a few bundles. Awesome!

However the site, with the same exact files, on my web host, fails. All the bundle loads result in 404 errors.

My guess is that this is maybe a directory permission problem on the host? I tried giving the anonymous user rights to write to various directories, but that didn't make a difference. Where are these actual bundles being stored on the web server to be served up? I can't even begin to diagnose what is going wrong. I've looked very carefully at my local vs. host web.config looking for differences, and I can't spot anything obvious that has anything to do with bundling...

Anyone have any tips on how I can get this working or figure out why it is failing?

For now I've set BundleTable.EnableOptimizations = false in BundleConfig.cs to turn it all off, which works fine.



Viewing all 3509 articles
Browse latest View live




Latest Images