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

Free developing and hosting with ASP.Net

$
0
0

Hi all,

I'm building a personal project that depending on its acceptance it might become a professional product, which may mean creating a company and so on.

I have background in Microsoft technologies, and my prototype should be a web site (ASP.Net for example). I would prefer to use ASP.Net since I have know how but I'd like to keep license costs as zero (at least for now).

In order to overcome SQL Server limits for free usage, I'm thinking on using ASP.Net + MySql for the DB engine. My question is that this is a free of charge option (except for the hosting of course)?

Thank you!


Can I open a ASP.NET 2.0 web site (web forms) in VS2013?

$
0
0

Hi,

I'm currently working in VS2008 on ASP.NET 2.0 web site (as opposed to web application) projects.

Is VS2013 backward compatible such that I should be able to use it for these web site projects in their current forms (continuing to use the .NET Framework 2.0)? Or will I be forced to make updates to code/web.config/other to make it compatible with a newer version of ASP.NET immediately upon opening these projects in VS2013?

Thanks in advance!

P.S. Unless I'm overlooking something, this link about VS2013 Compatibility does not appear to address my question: https://msdn.microsoft.com/en-us/library/hh266747.aspx

Make Services Which Will Check File in Folder and Run Batch File

$
0
0

I want to make the services that I would like to install in server, it should run the batch file once I will send one specific file to the folder

I start from this can someone guide me how i finish.
Thanks

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.ServiceProcess;
using System.Text;
using System.Threading;

namespace FolderWatch
{
    public partial class Service1 : ServiceBase
    {
        public Service1()
        {
            InitializeComponent();
        }

        private System.Timers.Timer timer1;
        protected override void OnStart(string[] args)
        {
            WriteLogs("Starting .....  ");
            timer1 = new System.Timers.Timer();
            timer1.Interval = 15000;
            timer1.Elapsed += timer1_Elapsed;
            timer1.Start();
        }

        void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            //WriteLogs("Interval click");
            timer1.Stop();
            watching();
            timer1.Start();
        }

        private static void watching()
        {
            try
            {
               // WriteLogs("Watching Start");
                string sourcePath = @"C:\ESLFile\";

Open popup window with scrollbars and pass selected value back to parent program

$
0
0

I'm using Visual Web Developer Express 2010 with SQL Server 2008 Express, VB.  This is a two part issue.

Part 1:

I'm opening a popup window and need the scrollbars to display but nothing seems to work.

    Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
        Button20.Attributes.Add("onclick", "window.open('Footprints.aspx','','height=800,width=800', 'scrollbars=yes');return false")
    End Sub

The window opens correctly when I click button20 and the contents are displayed correctly but the scrollbars are not present.  The contents can move with the page up/down keys only.

Does anybody have an idea what I'm missing?

Part 2:

Is it possible to pass the value of selected items (in this case a string value) in the popup window back to the parent program?

Thanks!

dynamicly created controlls

$
0
0
public partial class topicos : System.Web.UI.Page
{
    static Table tableResult;

    public static class MyClass
    {
        public static int valor { get; set; }
        public static int valor2 { get; set; }
    }

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        validar();
    }
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            MyClass.valor = 0;
            MyClass.valor2 = 210;
        }

    }

    string strCon = "Data Source=localhost\\SQLEXPRESS; Initial Catalog=Dados;Integrated Security=True";
    protected void submeter_Click(object sender, EventArgs e)
    {
        string filename = Path.GetFileName(imagens.PostedFile.FileName);

        Stream str = imagens.PostedFile.InputStream;
        BinaryReader br = new BinaryReader(str);
        Byte[] size = br.ReadBytes((int)str.Length);
        using (SqlConnection con = new SqlConnection(strCon))
        {
            using (SqlCommand cmd = new SqlCommand())
            {

                cmd.CommandText = "insert into topicos(nome,data,tipo,URL,topico) values(@nome,@data,@tipo,@URL,@topico)";
                cmd.Parameters.AddWithValue("@nome", filename);
                cmd.Parameters.AddWithValue("@data", size);
                cmd.Parameters.AddWithValue("@URL", Convert.ToString(URL.Text));
                cmd.Parameters.AddWithValue("@topico", Convert.ToString(Topico.Text));
                cmd.Parameters.AddWithValue("@tipo", Convert.ToString(tipo.SelectedItem));

                cmd.Connection = con;
                con.Open();
                cmd.ExecuteNonQuery();
                con.Close();
            }
        }

        MyClass.valor++;
        ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + MyClass.valor + "');", true);
    }

    [WebMethod]
    protected void validar()
    {

        using (SqlConnection con = new SqlConnection(strCon))
        {
            using (SqlCommand cmd = new SqlCommand())
            {
                cmd.CommandText = "select top(" + MyClass.valor + ") * from topicos order by id desc";

                cmd.Connection = con;
                con.Open();
                SqlDataReader dr = cmd.ExecuteReader();
                tableResult = new Table();
                tableResult.GridLines = GridLines.Both;
                Unit width = new Unit(115, UnitType.Pixel);
                Unit width2 = new Unit(176, UnitType.Pixel);
                Unit width3 = new Unit(289, UnitType.Pixel);
                while (dr.Read())
                {
                    TableRow ar = new TableRow();
                    TableCell tipo2 = new TableCell();
                    Label tipo = new Label();
                    tipo.Width = width;
                    tipo.ID = "tipo_" + MyClass.valor;
                    tipo.Text = dr["tipo"].ToString();
                    tipo2.Controls.Add(tipo);
                    ar.Cells.Add(tipo2);
                    TableCell URL2 = new TableCell();
                    Label URL = new Label();
                    URL.Width = width2;
                    URL.ID = "URL_"+MyClass.valor;
                    URL.Text = dr["URL"].ToString();
                    URL2.Controls.Add(URL);
                    ar.Cells.Add(URL2);

                    TableCell topico2 = new TableCell();
                    Label topico = new Label();
                    //CheckBox teste1=new CheckBox();
                    //teste1.ID = "aa";
                    //teste1.Text = "ttt";
                    //teste1.Checked = true;
                    topico.Width = width2;
                    topico.ID = "topico_" + MyClass.valor;
                    topico.Text = dr["topico"].ToString();
                    topico2.Controls.Add(topico);
                    //topico2.Controls.Add(teste1);
                    ar.Cells.Add(topico2);


                    TableCell nome2 = new TableCell();
                    Label nome = new Label();
                    nome.Width = width3;
                   // Button eliminar = new Button();
                   // eliminar.Text = "eliminar";
                   // eliminar.ID = "eliminar2";
                   // eliminar.OnClientClick = "DeleteRow(this); return false;";
                   // eliminar.Attributes.Add("onClick", "return ShowMessage()");
                   // eliminar.Attributes.Add("runat", "server");
                   // eliminar.Click += new System.EventHandler(this.ShowMessage); 
                    nome.ID = "nome_" + MyClass.valor;
                    nome.Text = dr["nome"].ToString();
                    nome2.Controls.Add(nome);
                    //nome2.Controls.Add(eliminar);
                    ar.Cells.Add(nome2);


                    TableCell eliminar2 = new TableCell();
                    Button eliminar = new Button();
                    eliminar.Text = "eliminar";
                    eliminar.ID = "eliminar_" + MyClass.valor;
                    eliminar.Attributes.Add("runat", "server");
                    eliminar.Click += new System.EventHandler(this.apagar);
                    eliminar2.Controls.Add(eliminar);
                    ar.Cells.Add(eliminar2);
                    tableResult.Rows.Add(ar);
                    resultHolder.Controls.Add(tableResult);
                }
                con.Close();

            }
        }

    }



    void apagar(Object sender, EventArgs e)
    {
        ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('teste');", true);

    }


need to create several buttons that do something at runtime, the buttons are created each time i press "add more button" problem is that dunno why but instead of creating just 1 button program creates 2 buttons with the same name :( can anyone help ? 

Drop Box issues

$
0
0

I am using a 2015 version of VS Community. I have two comboboxes on a form.

When I click cbxA and select a value the value changes but it also changes in cbxB. I am trying to use the interface and assign databound items. I have a table 1 and table 2. Table 2 holds two field name and ID.

Both comboboxes are set up to display the same display member and value member. But each one has its own selected value. What would cause the value of cbxB to change when I select a value in cbxA?

Visual Studio 2010 does not load current files anymore

$
0
0

I have been using Visual Studio 2010 Express for quite sometime now. After closing with files opened (and saved) it would always remember the files and reload them upon a new startup. But today that doesn't happen anymore.

I can't find an option that may need to be turned on again.

Does anyone know where that option is?

dynamicly created buttons

$
0
0

i need to generate buttons dinamicly in code behind, when i press "add more " button  it all works fine but when i press one of  buttons that was generated program adds one more button and i cant understand why that hapening

 public static class MyClass
    {
        public static bool clicado;
        public static int valor { get; set; }
        public static int valor2 { get; set; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            MyClass.valor = 0;
            MyClass.clicado = true;
        }

        if (MyClass.clicado == true && Page.IsPostBack)
        {
            MyClass.valor++;
            MyClass.clicado = false;
        }
        //else if (MyClass.valor == 0)
        //{
        //    MyClass.valor = 1;
        //}

        //if (MyClass.clicado == true)
        //{
        //    for (int i = 0; i > MyClass.valor; i++)
        //    {
        //    }
        //}
        //MyClass.clicado = false;
        CreateButtons();
        MyClass.valor2 = 0;
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        MyClass.clicado = true;
         //MyClass.valor++;
    }
    private void CreateButtons()
    {
        for (int i = 0; i < MyClass.valor;i++ )
        {
            Button button = new Button();
            button.Text = "ola";
            button.ID = "ola_" + MyClass.valor2++;
            button.Click += new EventHandler(ShowMessage);
            button.Attributes.Add("runat", "server");
            resultHolder.Controls.Add(button);
        }

    }
  
    void ShowMessage(Object sender, EventArgs e)
    {
        ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('isto é um teste');", true);
    }


How Do I Add an Embedded Resource to a “Class Library (Package)” Project in VS 2015 RC?

$
0
0

There is a new project template in the Visual Studio 2015 release candidate called "Class Library (Package)." It's in the Visual C#/Web category. In the information panel of the project type, it says "PREVIEW - A project template for creating a class library as a NuGet package that can target any platform."

I'm doing something similar that I did in a normal Class Library project and involves an embedded resource. Normally, there's an option in the Properties dialog that allows you to specify a "Build Action." You can then select "Embedded Resource." That option does not appear in the Properties dialog for a file in a "Class Library (Project)" project.

Does anybody know how to add an embedded resource to a "Class Library (Package)" project in VS 2015 RC? Is it even possible?

Visual Studio 2015 RC keeps crashing after run

$
0
0

I just updated my Visual Studio 2015 CTP6 to Visual Studio 2015 RC Enterprise - it works on my VM with Windows 10 TP, but on my local machine with Windows 8.1 it keeps crashing just after running (after the splash screen closes) - what can I do? Where can I find some traces?

When I click "debug" that are the exception details:

System.Reflection.TargetInvocationException was unhandled
Message: An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an invocation.

Can I use google docs to store website files from Visual Studio?

$
0
0

I moved from Webmatrix to Visual Studio Community a few weeks ago. With webmatrix, I'm am able to store my files on google drive and open the sites anywhere and still have my packages and use NuGet without a problem...but with visual studio I've had a hard time. I cant seem to be able to create a new website and have all of the files including packages and .sln file in the same folder. When I open the website on another computer and use NuGet, it gives me errors that packages are not found.

Does anyone know how set this up?

Bookmark Toolbar missing

$
0
0

I have shifted to Visual Web Developer 2010 Express beta 2, and I can't the Tool bar for setting/removing bookmarks in code. Is this function removed from the new version or is it just an error to be fixed in later versions? 

Adiing DLL file in to ASP.NET

$
0
0

Hi,

       I'am new to Dot Net I have developed Authentication  Dll files in C# I want to integrate those dll files into my asp project How can do it and  add dll File into Web Application .It rus at server.

Opening Project in VS produces reports IIS Express error.

$
0
0

I have a project that runs on https://localhost:44306 .  Yesterday by my manager's requirement I published the project for deployment to a test machine for the customers (which also is using IIS Express and is running IIS Express from the command.  However, the IIS Express on that machine for some unknown reason is not able to be configured to use SSL.  Therefore before publishing I changed the project properties so as to run usinghttp://localhost:51716 , and changed SSL Enabled to false.  (I've since discovered that this was not necessary as the web app would run under whatever bindings were entered in applicationHost.config for that web app no matter what it read when it was published.)

However, once the deployment was complete I switched the project back to SSL Enable = true and to run usignhttps://localhost:44306 .  I had to go into the applicationHost.config to put the SSL binding back into the Web site description.  However now whenever I open the project in VS 2012 I get an error message saying:

An error occured when applying the IIS Express settings 
to server URL 'https://localhost:44306' for project 'projectName'. 
You may have to manually edit the applicationHost.config file 
and make changes for your site to run correctly.

Since I've already done that then I am not sure what possible error IIS Express could be experiencing.  There is nothing in the IIS Express log files to indicate that an error even occurred.  Nor is there anything in the Event Viewer logs to show ANY error.  I cannot find any Visual Studio 2012 error logs. 

While one may be attempted to recommend that this thread be posted on the IIS.Net forums, I've found over the past year that the contributors to  that forum are unconversant with IIS Express and do not bother answer queries about it.

So to quote Star Wars;  "Help me Obi-wan Kenobi; you're my only hope."

Code formatting issue in Visual Studio designer

$
0
0

I am using VS 2012 for web development. In visual studio designer, I can easily format the code using short cut: cntrl + k and cntrl + d. If any spaces or indents b/w h2 tags, they would be removed and formatted nicely as shown below:

<h2>hello</h2>

But if I use my custom tags like 'ct' (badly I need to use some of my own tags), visual studio is not able to format the code correctly with the same short cut.

<ct>hello</ct>

can any one suggest on how to fix this?


How to Customize toolbar

$
0
0

I am working in visual studio 2012 I would like to add more buttons to the IDE for me to use in MVC d is tesigner (sourceview ) so that I can edit the design of the pages ,only thing is that MVC does not supprot the manage styles feature! I me way that I can add the proper design elements to my toolbar? I have been trying  and no such  luck thus far! I would be looking for customize options that would allow me to add the buttons that I need to modify design. At the mpment I have been trying to customize the toolbar but the settings or all over the place. Please help!

Getting Hyperlink in Gridview from Access database

$
0
0

Hi,

I want to get data from an Access DB into my web app (VS Community 2015RC).

I have a page in my project with a Gridview control that fetches data from an Access DB. Everything works fine except for a hyperlink field.

In the Access DB the field is setup as a hyperlink, but when published in my web page it appears as a text field with the hyperlink data enclosed by #-tags and not as a clickable URL.

I have been struggling with this for some time, so any help would be appreciated from you clever guys

epe

Using Query Results

$
0
0

I have the following piece of code that is used to create a Fusion Chart.  The chart portion works.  There is a problem with the data variables or query results.  I use the exact same code with a different query and it works fine.  The error is "Invalid Data".  Do I need to format something??

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim connectionString As String
        Dim ds As New DataSet
        Dim stringxml As New StringBuilder

        connectionString = "Data Source=xxx;Initial Catalog=xxxxx;User ID=xxxxx;Password=xxxxx"
        stringxml.Append("<graph caption='Loss by Physcian' pallette='3' canvasbgalpha='0' bgimagealpha='30' bgimage='hosp2.jpg' bgimagescale='100' outCnvBaseFontSize='12' showvalues='1' baseFontSize='9' useroundedges='1' bgcolor='FF5904,FFFFFF'>")
        Using conn As New SqlConnection(connectionString)
            conn.Open()
            Dim qry As New SqlCommand("select sum(cost) as TotalLoss, physcian as Physcian from surgery_loss where task_date >= getdate()-30 group by physcian", conn)
            Dim rst As SqlDataReader = qry.ExecuteReader()

            While rst.Read()
                stringxml.AppendFormat("<set label='{0}' value='{1}'/>", rst("Physcian").ToString(), rst("TotalLoss").ToString())
            End While
            stringxml.Append("<styles>  <definition> <style name='glow1' type='glow' color='FF5904' aplha='55' blurX='13' blurY='13' /><style name='B' type='animation' easing='bounce' param= '_xscale' duration='1' /> <style name='Bevel1' type='bevel' angle='0' /> <style name='Anim1' type='animation' param='_xScale' start='0' duration='3' />  <style name='Anim2' type='animation' param='_alpha' start='0' duration='3' easing='bounce' /> </definition> <application> <apply toObject='CANVAS' styles='Anim1, Anim2, Bevel1' /> ")
            stringxml.Append("<apply toObject='DATAPLOT' styles='Anim1, Anim2, Bevel1, B' />")
            stringxml.Append("<apply toObject='Canvas' styles='Anim1, Anim2, Bevel1, Glow1' />")
            stringxml.Append("</application> </styles>")
            stringxml.Append("</graph>")

            rst.Close()
            conn.Close()
            Literal1.Text = FusionCharts.RenderChart("FusionCharts/Bar2D.swf", "", stringxml.ToString(), "Physcian", "800", "400", _
                                                     False, True)
        End Using

    End Sub

Web Site Project in Visual Studio 2013 Community is not displaying when testing in a browser.

$
0
0

I have recently installed VS2013 Community and copied over a web site project from Visual Web Developer 2010 Express. The site pages all load and open fine in the development window but when I try to test the site in a browser I am receiving the following error:

Request is not available in this context             
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.             
Exception Details: System.Web.HttpException: Request is not available in this context

What is also strange is that when I open the site in 2010, and change the local server to use IIS, I get the same error. When using the old Web Dev Server in 2010 the site is displaying ok in the browser. I have searched the net to see if I can use the old Web Dev Server for 2013 and it appears that I can't.

I have a suspicion that the issue lies with IIS express but that's where I'm lost. For info I am running all this in Windows 7 SP1, as required by VS 2013.

Is anyone able to throw some light on this issue?

Cant find intellitrace

$
0
0

I have VS 2013 ultimate and I cant find intellitrace, its not in option cant find it anywhere. Not sure when I last saw it, I may have reinstalled since then, I also have VS 2015 community installed, I wonder if that has anything to do with it.
How to get intellitrace back?
Thanks

Viewing all 3509 articles
Browse latest View live