ASP.NET

125K

Solutions

28K

Contributors

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello I have a series of text boxes to record telephone numbers.  Like this:
Phone Number: (<asp:TextBox ID="txtContHomePh1" runat="server" MaxLength="3" Width="32px"></asp:TextBox>
                       )
                       <asp:TextBox ID="txtContHomePh2" runat="server" MaxLength="3" Width="31px"></asp:TextBox>
                       &nbsp;-
                       <asp:TextBox ID="txtContHomePh3" runat="server" MaxLength="4" Width="49px"></asp:TextBox>

Open in new window

txtContHomePh1 is the area code, txtContHomePh2 is for the next 3 number, and txtContHomePh3 is for the last 4 digits. I want a RequiredFieldValidator to make sure the user fills out the boxes.  Can I use just 1 for all 3 textboxes? Or do I have to put one on each text box?
0
Hi,

Once again coming from a beginner perspective so I can start to do some reading for curiosity.

I know that ASP.NET core web apps have to handle things to handle different screen sizes. For example a client might
browse from a phone or a PC or a tablet.

How is this detected and handled basically.

What term should I be looking for in the documentation and tutorials to see how this is approached.?

Also really to ask how difficult this is to code and handle in general.

Thanks,

Ward
0
Hi,

Can an ASP.NET Core app support reading and writing to an access database? BTW this would be a ASP.Core app running on a Linux host.

https://blogs.msdn.microsoft.com/dotnet/2016/11/09/net-core-data-access/

I assume it cant but wanted to double check in case there is another way.

Thanks,

Ward
0
Hi, I need to install C# Application the Network sharing place. Then all the users to access the EXE file.
without installing all the user's machine individually. How to do that.
Many Thanks
0
Hi,

I am wanting to ultimatly learn ASP.NET core and have found the following course.

https://www.udemy.com/aspnet-mvc-quick-start/

I am looking at this as just an intro type course. To give me an idea of it before going deeper.

I am comming from a C# / Winforms background with no web. To give you a perspective of my knowledge set.

Anyway what I am wondering is how much this would be wasted (if anything) on a learning journey to ASP.NET core.

From what I can see is ASP.NET runs on windows and .NET core can run on other OS besides windows. However what about *all* the rest.

Is ASP.NET Core a superset of ASP.NET. Still has MVC? Do both have angular?

Thanks,

Ward.
0
Hello,

Hello, i am creating ASP.net application using web browser my application locally working fine after that hosting this application in our server ... application not working not showing any data and no error show...
1. web browser control permission problem in my VPN windows server 2012 r2?
 2. web browser control install windows server 2012 r2 ?
3. how to permit this control in our VPN windows server 2012 r2 ?
0
I'm uploading a file, using an asp FileUpload control but want to change the default text after a successful upload. When the control/page renders the default text is: "No file selected". It also defaults to this after the successful upload. I'd like to change it to something else if that's possible? Thanks.

<asp:FileUpload ID="flupldIAAPhotos" runat="server" />

Open in new window

0
1. I have this in MVC routeconfig
 public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

           
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );


        }

Open in new window


2. I have this Controller

  // [HttpPost]
        public ActionResult Index(string formId)
        {

            ViewBag.FormId = formId;
            return View();
        }

Open in new window


3. This works and when I get to the controller, I see "formId"'s value. The URL shows as ?/index/1

  $scope.openForm = function (formId) {

            //console.log(JSON.stringify(formId))

          
            window.location = "/displayform/index/?formId=" + formId; //https://stackoverflow.com/questions/37031143/asp-net-angularjs-how-to-click-on-link-and-route-to-controller-method-with-id

        };

Open in new window


How come these don't work...I step thru it and 'formId" comes out as null. I added HttpPost as well to the MVC Controller. what am I missing?


 window.location = "/displayform/index/"+ formId;

Open in new window



window.open('/displayform/index/' + formId, '_self', false);

Open in new window

0
For years we have been using the following vb code in a Classic ASP page to retrieve data from a software product.
To boost performance and get away from Classic ASP, I need to ASHX C# equivalent of the following  

    //set h = CreateObject("MSXML2.SERVERXMLHTTP")
    //h.open"POST", "http://localhost/isapi/webapi.dll"  //this is a software provided dll that accepts xml objects and returns xml response objects
    //h.setOption(2) = 4096
    //h.send(doc)
    //response.Write("<br><textarea rows=\"20\" cols=\"60\">" + h.responseText + "</textarea>");    
    //for each response in h.responseXml.selectnodes("//Response")
    //response.Write("<br><textarea rows=\"20\" cols=\"60\">" + response.xml + "</textarea>");
    //next
runner.txt
0
Hi I am using asp.net application and I am using asp:menu. At one point I am disabling menu but on IE11 and chrome It still looks like active(It's not clickable but color looks same), I tried to change menu color from codebehind but when It switch back to that menu as enabled then it doesn't work properly,How I can fix this problem?

Regards,
Sudhanshu
0
protected void btnsave_Click(object sender, EventArgs e)
    {
        try
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
            using (SqlCommand cmm = new SqlCommand())
            {
                cmm.Connection = cnn;
                cmm.CommandType = CommandType.Text;
                if (btnsave.Text == "Save")
                {
                    cmm.CommandText = "INSERT INTO register_user([name],[email],[email_pass],[panel_pass],[dept])" + "VALUES(@name,@email,@email_pass,@panel_pass,@dept)";
 
                    cmm.Parameters.AddWithValue("@name", txtname.Text.Trim().ToString());
                    cmm.Parameters.AddWithValue("@email", txtemail.Text.Trim().ToString());
                    cmm.Parameters.AddWithValue("@email_pass", txtemailpass.Text.Trim().ToString());
                    cmm.Parameters.AddWithValue("@panel_pass", txtpass.Text.Trim().ToString());
                    cmm.Parameters.AddWithValue("@dept", ddldept.Text.Trim().ToString());
                   
                }
 
                else
                {
                    cmm.CommandText = "UPDATE [register_user] SET name=@name,email=@email,email_pass=@email_pass,panel_pass=@panel_pass,dept=@dept where id=" + ViewState["id"];
 
                    cmm.Parameters.AddWithValue("@name", txtname.Text.Trim().ToString());
                    …
0
I'm looking for a solution and I thought a client side javascript function  will work. This function will assign the text or title value of a tab  to a particular control.
0
I have a label control in my Masterpage and I would like the  text property of tab I click in the child place
assigned to the label in the Masterpage. Please show example.

 <ul class="tabs" id="thistab" runat="server">

                <li class="tab-link current" data-tab="tab-1" id="tab11" data-toggle="tab"><a href="#Person">Personal Info</a></li>

                <li class="tab-link" data-tab="tab-6" id="tab16"><a href="#Info" data-toggle="tab"                <li class="tab-link" data-tab="tab-2" id="tab12"><a href="#Assign" data-toggle="tab" title="Assignment History">Assignment History</a></li>
                <li class="tab-link" data-tab="tab-3" id="tab13"><a href="#Issues" data-toggle="tab" title="Issues">Issues</a>

</ul>

Open in new window

0
Hi All,

Can you help me resolve this issue on button click?

an unknown error has occurred while processing the request on the server. the status code returned from the server was 500
0
I have a side menu and I click on a link. I want to redirect the user to another page and pass a parameter.

1. In Razor, I do this

 <button ng-click="openForm(row.Id)"  class="btn btn-primary btn-border btn-rounded-20 btn-ef btn-ef-4 btn-ef-4b mb-10">{{row.FormName}}<i class="fa fa-arrow-right"></i></button>

Open in new window


2. In AngularJS controller, I have this
 $scope.openForm = function (formId) {

            //console.log(JSON.stringify(formId))

            //$http({
            //        method: 'POST',
            //        url: '/displayform/index',
            //        data: JSON.stringify(formId),
            //        contentType: "application/json",
            //        dataType: "json"

            //}
               
             

            //    ).then(function () { });

          //  window.open('/displayform/index/' + formId, '_self', false);

            window.location = "/displayform/index/?formId=" + formId; 

        };

Open in new window


3. In C# controller
 // [HttpPost]
        public ActionResult Index(string formId)
        {

            ViewBag.FormId = formId;
            return View();
        }

Open in new window


4. The URL looks like this when the user is redirected
http://localhost:63410/displayform/index/?formId=1

Is there a better way of doing this? I wanted the URL to look like this but couldn't get it working...the passed parameter comes out as null http://localhost:63410/displayform/index/1
0
I've got a working ASP app with a gridview populated via a SQL select string.
I'd like to add a column at the end of the gridview, and populate it in a For loop, where I'm doing some other checks when the gridview refreshes..

Something like:
                    GridView1.Rows(i).Cells("MYNEWCOLUMNNAME").Text = "hi"

Open in new window

I tried adding a new column in the gui "SITE", as a BoundField, but I'm thinking this isn't going to work quite that easily..

Thoughts?
0
I need to build mvc app that basically allow someone to crud
The xml file. The xml is just like we have products in each Usa states.

What is the approach to get it start? I know mvc has crud already but after I try it and I don't really want to use it because it takes me a long time to customize the ways I want it to be.

Overall, try to get it up faster and hope to find some tools for development in general.

Thanks
0
Hello Experts,
I am trying to sort few columns in a Gridview.  All the Alpha columns working as expected.  But, I have a numeric column (Serial Number) not working as expected.  Please see below and let me know how to fix it.

Thank you very much in advance.

Serial Number (when page loaded)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Serial Number (when sorted)
1
10
11
12
13
14
15
2
3
4
5
6
7
8
9
0
Hi, Please let me know how to fix this issue.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="default" MasterPageFile="~/Masterpage.Master"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp"%>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
  <iframe id="frameName1" src="index.aspx" frameborder="0" scrolling="auto" width="30%" height="1000px" align="left"></iframe>
     <iframe id="frameName2" src="home.htm" frameborder="0" scrolling="auto" width="70%" height="1000px" align="right"></iframe>
     
 
         <script src="scripts/jquery-1.12.4.js" type="text/javascript"></script>
    <script type="text/javascript">
var sessionTimeout = "<%= Session.Timeout %>";
function DisplaySessionTimeout(timeout) {
    var seconds = timeout / 1000;
    document.getElementsByName("seconds").innerHTML = seconds;
    setInterval(function () {
        seconds--;
        document.getElementById("seconds").innerHTML = seconds;
    }, 1000);
    setTimeout(function () {
        //Show Popup before 20 seconds of timeout.
        $("#ExpireConfirm_Submit").dialog({
            height: 200,
            width: 400,
            resizable: false,               
            modal: true,               
            title: "Session Expire Confirmation",                             
            open: 

Open in new window

0
Hi Experts,

I have a gridview. one of its column has s plus sign. When I click the plus sign it makes the other gridview visible . When I click the minus sign it is invisible. Is there anyway I can save the data of the popup gridview in a dataset or a datatable when the minus sign is clicked. I have attached the screenshots.

Thanks in advance.


Code for + and -
----------------------------

 <script  type="text/javascript" src="Jqueries/jquery_nestedGrid.min.js"></script>
     <script type="text/javascript">
         $("[src*=plus]").live("click", function () {
             $(this).closest("tr").after("<tr><td></td><td colspan = '900'>" + $(this).next().html() + "</td></tr>")
             $(this).attr("src", "images/minus.png");
             
         });
         $("[src*=minus]").live("click", function () {
             $(this).attr("src", "images/plus.png");
             $(this).closest("tr").next().remove();
         });
     </script>


Gridview column
---------------------------
  <asp:TemplateField ItemStyle-Width="4%">
                    <ItemTemplate>
                        <asp:image alt = "" style="cursor: pointer;" src="images/plus.png" id="ImgPlusMinus" runat="server" />
                        <asp:Panel ID="pnlOrders" runat="server" Style="display: none">
                            <asp:GridView ID="gvVendors" runat="server" AutoGenerateColumns="false" CssClass = "ChildGrid SetLeftMarginChildGrid">
                          …
0
Hello. I have a checkbox list. I want to make it required.  Meaning I want the user to check at least one box in the list.  None of the required field validators work for me.  I also tried doing a javascript validator but I couldn't get that to work.  This is my checboxlist code:

<asp:CheckBoxList ID="cblEduAssistPlans" runat="server" SelectedIndexChanged="cblEduAssistPlans_SelectedIndexChanged" AutoPostBack="true">
                       <asp:ListItem>Individualized education program (IEP)</asp:ListItem>
                       <asp:ListItem>Individualized Family Service Plan (IFSP)</asp:ListItem>
                       <asp:ListItem>504 Plan</asp:ListItem>
                       <asp:ListItem>Other</asp:ListItem>
                   </asp:CheckBoxList>

Open in new window

0
I'm using C# in a ASP.NET web application

In my C# code i have this line where I save today's date into a variable.

Todays date is 11/6/2017

With this code below. The value that gets saved in my variable looks like this: 11/6/2017 8:18:23 AM

// save todays date in a variable
DateTime testvar1 = DateTime.Now;

How do I format DateTime.Now so it save all the digits for the month and day.

I want the value saved in the variable to be this:
11/06/2017 8:18:23 AM

If today's date was 9/5/2017 the value saved in the variable would be this:
Basically add the zeros for single digit months and days.
09/05/2017 8:18:23 AM
0
We moved a asp.net project from Visual Studio 2013 to Visual Studio 2017. The issue is that when you make changes to the JavaScript file, the changes are not effected on the min file. Also, when you checkout JavaScript file for edit, the min and map files are not checked out. We are using VSS for code control. How do we fix this issue?
0
Sample URL's

 /book_tour.aspx?year=2017&tourcode=8240&strdate=18/Jul/2017&endDate=28/Jul/2017&strdept=824070718Z
/book_tour.aspx?year=2017&tourcode=9020&strdate=25/Feb/2017&endDate=05/Mar/2017&strdept=902070225

Our site is a dynamic site where data is pulled through API.

I'm not sure if something has to be tweaked in wordpress or htaccess file. Also another biggest issue is, our organic traffic has dropped 80%, I understand that initially when platform changes, there will be a traffic drop but it's not improving month on month. Did we do something wrong in migration, I'm not sure, Please help.
0
I want to install this

https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome

I get a message that Visual Studio needs to install it.

In VS, I went to Tools --> Extensions and Updates but I dont see "Debugger for Chrome". I searched "online" in the screen

I see these when I search for Chrome

screenshot
0

ASP.NET

125K

Solutions

28K

Contributors

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications