ASP.NET

123K

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

Failed to install web server service IIS windows authentication & ASP due to error "Attempt to install ASP failed  with error code 0x8007007E. The specified module could not be found &  "Attempt to install windows authentication failed  with error code 0x8007007E. The specified module could not be found
0
Salesforce Has Never Been Easier
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Greetings again,

I have this RadioButtonList control with a Yes or option in Repeater control.

                 Purchased:<asp:radiobuttonlist ID="rblType" runat="server" RepeatDirection="Horizontal" TextAlign="Right" style="display:inline;">
                 <asp:ListItem Text="New" />
                 <asp:ListItem Text="Used" />
                </asp:RadioButtonList>

Open in new window


All I am trying to do is to ensure that user chooses either Yes or No before continuing.

I have done a lot RadioButtonList validations but have not found anything that works with Repeater control.

Any ideas experts?
0
We have a website and we want to record some instructions --> open the site, login, go thru the menus, etc. Like an instruction video.

Someone tried Webex, it didn't work (he said he gave up). Another tried Skype but couldn't get it working.

I found this that's free download  https://www.bandicam.com/  (they have a paid version too)

That works but anyone has used it? I don't know how to record my voice.

Any other tools I can use?
0
Hi,
i created dynamically  html button server side using c# code and  onclick() event , i am  calling server side method() on page post-back ...in server side redirect method some parameters are used ...

I want to redirect page in new tab and keep existing page as it is, please provide your solution  with onclick() event or server side code.

Server side dynamic html code created for link button:
fileTest.Append(" <span>");
fileTest.Append("<a id=\"lnkPsBtn" + TestCatBuilder.GetCategoryById(category.CategoryId).Name + "\" name =\"lnkPsBtn" + TestCatBuilder.GetCategoryById(category.CategoryId).Name + "\"onclick=\"SearchTestData('" + TestCatBuilder.GetCategoryById(category.CategoryId).Id + "')\" > ");
                    fileTest.Append(TestCatBuilder.GetCategoryById(category.CategoryId).Name);
                    fileTest.Append("</a></span>");
 
 Script code:
<script type="text/javascript">
        function SearchTestData(someid) {
            __doPostBack("lnkPsBtn" + someid, someid);
        }
 
        // Postback
        function __doPostBack(eventTarget, eventArgument) {
            if (!theForm.onsubmit || (theForm.onsubmit() !== false)) {
                theForm.__EVENTTARGET.value = eventTarget;
                theForm.__EVENTARGUMENT.value = eventArgument;
                theForm.submit();
            }
        }
    </script>
 
 
Test.Redirect(urlParams);
 
  /// <summary>
        /// this will redirect the current HttpContext to the …
0
I need for a manager to set a user's password on request.  I can reset the password, but the user still can't log in.  I have provided the code I am using below:

        [HttpPost]
        [AllowAnonymous]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> ResetPassword(ResetPasswordViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }
            var user = await UserManager.FindByNameAsync(model.UserName);
            if (user == null)
            {
                // Don't reveal that the user does not exist
                return RedirectToAction("ResetPasswordConfirmation", "Account");
            }

            
            string resetToken = await UserManager.GeneratePasswordResetTokenAsync(user.Id);

            var result = await UserManager.ResetPasswordAsync(user.Id, resetToken, model.Password);
            if (result.Succeeded)
            {
                using (var db = new RPIADbContext())
                {
                    var id = user.Id;
                    var usr = db.AspNetUsers.Find(id);
                    usr.MustChangePassword = true;

                    db.AspNetUsers.Attach(usr);

                    db.Entry(usr).Property(x => x.MustChangePassword).IsModified = true;
                    db.SaveChanges();
                }
                ViewBag.IsEdit = 1;
                return RedirectToAction("ResetPasswordConfirmation", "Account");

Open in new window

0
I had this question after viewing Looking for a new laptop.

I'm looking at Lenovo X1 that "Experienced Member" (I love the username :)) suggested (here is the link http://www3.lenovo.com/ca/en/laptops/thinkpad/thinkpad-x/X1-Carbon-5th-Generation/p/22TP2TXX15G)

I wonder if Amazon has it. I looked and one came up.

Should I choose "Windows Home 10" Or "Pro"? this is the screenshot
laptop
0
I already have model and controller that basically doing all the work I need. model is basically our domain class.
and controller is just all of combined classes that do all the thing we want like add, modify the data in xml or database.

our next is to create restful API that allow external users to use it. Do you have very simple example for us to get start it?
0
Before the Gridview at the bottom I need a button to add a new record but I can not figure out the html to make it work.

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Admin.aspx.cs" Inherits="Test.Admin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" lang="javascript">
        $(document).ready(function () {

            //Initialize the Account Termination Date datepicker
            $('#divDatePicker').datetimepicker({
                format: 'MM/DD/YYYY',
                useCurrent: false,
                minDate: new Date(),
                maxDate: new Date().setYear(new Date().getFullYear() + 1)
            });
           
            //Initialize the BootGrid
            $(function () {
                $('#<%= grdAdmin.ClientID %>').bootgrid({
                    caseSensitive: false,
                    formatters: {
                        "commands": function(column, row)
                        {
                            var buttonText;



                            buttonText = "<button type=\"button\" class=\"btn btn-xs btn-default command-add\" data-row-id=\"" + row.ID + "\"><span class=\"fa fa-camera\"></span></button>" +
                                "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.ID + "\"><span class=\"fa fa-pencil\"></span></button> " +
     …
0
I'm looking to buy a new laptop. I want it to be light and to use for .Net development. It needs to be light.

On my current laptop, I have:  VS 2013 and VS2015 (community), SQL 2014 and SQL 2016 (developer editions)

1. No Toshiba. I already have one and don't like it. It's not for development.  I got it maybe 4 yrs ago.

2. I have a gaming laptop. It's MSI but it's so heavy and running out of disk space when I installed SQL 2016.

3. At work, we have Dell laptops. Seems like a good laptop but screen is too small. At my previous job, my coworker had Surface but again, the screen was too small. I think 15 inch screen would be good.

4. I know I need SSD and i7 processor
Is this a good one? Any recommendations?
Dell Latitude E7470 Business Ultrabook 14 Inch i7-6600U 16GB DDR4 Windows 10 Pro (256G)
1
I am struggling to get a handle on this problem.

I have a textbox on Gridview control:

<asp:TextBox ID="txtboatRegNo" style="width:270px;margin-left:195px;" runat="server"></asp:TextBox>

Open in new window


and a textbox on Repeater control:

<asp:TextBox ID="txtARegNo" style="width:270px;margin-left:195px;" runat="server"></asp:TextBox>

Open in new window


The values for both textbox controls are the same.

The current process asks user to enter his registration number on Griview and the click next to go next page.

On next page, there is a different set of requirements that asks user to once again, enter the same registration number.

We see this as being extremely inefficient.

So, we decided that once a user enters his/her registration number on txtboatRegNo on Gridview, that value should auto fill the txtARegNo on Repeater control.

So far, the following query is not working in that it is not auto filling the value enter in Gridview on the Repeater control.

Does anyone know how to resolve this?

This is the script I have been working with:

  <script type="text/javascript">
         $(function () {
             $('[id*=txtboatRegNo]').change(function () {
                 $('[id*=txtARegNo]').val(this.value);
             });
         });
 </script>

Open in new window


Thanks in advance
0
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Im working with ajax toolkit tabs it is working properly but when i am adding bootstrap css files the tabs css  overwrite
Can u Help me to SOlve this problem?
Thanks in advance
0
I created new ASP.NET WEB Form project in  VS2010
according  to web.config file
<add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
  </connectionStrings>
I assumed to see aspnetdb.mdf in App_Data folder
But  I do not see anything , the folder is empty
0
Anyone knows how to get year, model, and maker for all Rv or motorhome or trailers? I have a project to build website that need to get Rv information for insurance quote ...


Thanks
0
today when i want to start to dubug ms asp.net website program the dianostic tools say it starting but does not do anythin. I triad anoter project and it still will not start. any ideas
0
How would you modify the following validation expression in ASP.NET  

^(\d){1,18}(\.\d{1,2})?$

to require a decimal point and ONLY 2 decimal places after the decimal point?

max value:           99,999,999,999,999.99

The value should be > 0.00
0
When I click the button(add to cart) after selecting a qty from my dropdownlist, my cart page will show qty from the ddl. However the cart only shows 1 qty for the item in the cart page no matter what qty I select for my ddl !! Its only each time that I click the button that the qty in the cart page will increase... how do u change this??

This is the add to cart button code
  protected void btnAdd_Click(object sender, EventArgs e)
    {
        string iDetailID = detail.EventDetail_ID.ToString();
        ShoppingCart.Instance.AddItem(iDetailID, detail); 

        int ddlAmount, participants, itemNr;
        if (ValidateInput(out ddlAmount, out participants, out itemNr))
        {
            l1.Text = "";
            SetCookie();
            UpdateEventParticipantes(ddlAmount, itemNr);
            Response.Redirect(string.Format("Detail.aspx?id={0}", itemNr));
        }
    }

Open in new window

My cart page
  protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadCart();
        }
    }
    protected void LoadCart()
    {
        gv_CartView.DataSource = ShoppingCart.Instance.Items;
        gv_CartView.DataBind();
        decimal total = 0.0m;
        foreach (ShoppingCartItem item in ShoppingCart.Instance.Items)
        {
            total = total + item.TotalPrice;
        }
        lbl_TotalPrice.Text = total.ToString();
    }
    protected void gv_CartView_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Remove")
        {
            lbl_Error.Text = "Message : " + e.CommandArgument.ToString();
            string detailId = e.CommandArgument.ToString();
            ShoppingCart.Instance.RemoveItem(detailId);
            LoadCart();
        }
    }

Open in new window

ShoppingCart CLASS

Open in new window

0
I get this error at this part// string iDetailID = detail.EventDetail_ID.ToString(); // how do I solve it??
 protected void btnAdd_Click(object sender, EventArgs e)
    {
        string iDetailID = detail.EventDetail_ID.ToString();
        ShoppingCart.Instance.AddItem(iDetailID, detail);

        int ddlAmount, participants, itemNr;
        if (ValidateInput(out ddlAmount, out participants, out itemNr))
        {
            l1.Text = "";
            SetCookie();
            UpdateEventParticipantes(ddlAmount, itemNr);
            Response.Redirect(string.Format("Detail.aspx?id={0}", itemNr));
        }
    }

Open in new window

0
Hi,
To this site
http://my-friend.co/Test_rec4/Default.aspx?userid=mc23

I want to decrease the width of the highlighted area (in red), and increase the width of the area (highlighted in yellow), and to put two more buttons (under current Delete button). Can you please show me the change for these?
16j.png
0
Greetings Experts,

Background:
ASP.NET 4.6.1
C#
Material-Components-Web (to add Material Design to page)


I'm trying to use Material-Components-Web in an ASP.NET Forms project. The following code shows an icon inside a button.

<button type="submit" name="ctl00$maincontent$btnRefresh" id="maincontent_btnRefresh" class="mdc-fab mdc-fab--mini lexbe-fab">
        <i class="material-icons"> refresh</i>
</button>

protected void btnRefresh_Click(object sender, System.EventArgs e)
{
       // Called.
}

Open in new window


If I click near the edge of the button it works and the event handler in code behind gets called.
However, if I click directly on the icon, then the even handler is not called.

Question: What's the right way to get the button to call the event handler even if it is the child icon that is clicked?

Thanks!
0
Free Tool: Site Down Detector
LVL 9
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

How would you modify the ValidationExpression to allow the input of only 2 decimal places?

ValidationExpression="(^(\$|)([1-9]\d{0,2}(\,\d{3})*|(([1-9]\d*))+|(0))\.\d{2}?$)">    

For example, a valid value "0.57".
0
I have a screen that a user can either enter information(about 5-6 fields) and click Add Item or they can enter in an ID(one of the fields) and click Search and it will populate all the other fields. This works great. I had RequiredFieldValidators for the fields that are mandatory(all of them) and I noticed that when I tried to do a search that the fields would have the validation messages next to them and it would never hit the code behind for the search button. Obviously the validator is working on the client side and doing its job but it wouldnt let the server side code to run? I want to have the functionality of the search button to fill the fields with data and for the RequiredFieldValidators to work when the Add Item is clicked.
 Now, I read where you can set EnableClientScript="true" in the validators(client side) and that allows the server side code to run when I click Add Item but then the validators are allowing missing fields. I tried to set the EnableClientScripts back to false but when I test and click Add Item, with no data, its saving a blank record and thats not cool!!!
Any thoughts on this? Any help would be appreciated!!!

Thanks
JK
0
I have an older website that build the home page by using an .aspx page as a frame, that includes other .aspx pages to make up the entire page. For example it is made up of about 4 different .aspx pages (i.e.: topMenu.aspx, leftPanel.aspx, righPanel.aspx, footer.aspx). These pieces are added by use of an include statement, into the HomePage.aspx.

  <!--leftPan -->
        <!--#include file ="../includes/leftPanel.aspx"-->
  <!--leftPan close -->

This is working but I need to make some changes to one of the included pages and I also need to add some C# code into the page. I've attempted to do this, based on my limited knowledge of this,  but am getting the following error:

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: BC30205: End of statement expected.

Source Error:


Line 1:  <Script Runat="Server">
Line 2:  		private void ibSearch_Click(object sender, System.Web.UI.ImageClickEventArgs e)
Line 3:  		{
Line 4:  			// Get search terms


Source File: E:\Sites\Intranet\includes\leftPanel2.aspx    Line: 2


Show Detailed Compiler Output:

Show Complete Compilation Source:


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1087.0 

Open in new window


my code is below:

<Script Runat="Server">
		private void 

Open in new window

0
Tthe problem is when you use a select button on a grid view the order the program is
 For the first click of button

 OrderList -                        Page Load
 CustomerDetail -             page load
 orderList -                        grid_selectedindexChange

 for the second click of button

 OrderList -                        Page Load
 CustomerDetail -             page load
 CustomerDetail -            load form
 orderList -                        grid_selectedindexChange

 Order that is should do


 OrderList -                        Page Load
 orderList -                        grid_selectedindexChange
 CustomerDetail -             page load
 CustomerDetail -            load form

 is there a way to do this


0
Still pretty green to MVC and need some guidance on how to accomplish what was so simple in web forms. I have a dropdown filled with names from a database. Each of the records that contains those names, also contains an ID. On the same view, I have a label. What I want to do, is change the value of the label when the dropdown selection changes. A simple, static example of how to do this would be great. At the very least, I'd like to just be pointed in the right direction.
0
1 error saying
Feature 'interpolated strings' is not available in C# 5.  Please use language version 6 or greater.
here is the code!!
 protected void SetCookie()
    {
        if (Request.Cookies["aa"] != null)
        {
            Response.Cookies["aa"].Value = Request.Cookies["aa"].Value + "|";
        }

        Response.Cookies["aa"].Value = Request.Cookies["aa"].Value + $"{lblTitle.Text},{lblPrice.Text},{lblDate.Text},{lblLocation.Text},{lblStartTime.Text},{lblEndTime.Text},{lblParticipants.Text},{lblDescription.Text},{lblItemNr.Text},{imgEvent.ToString()}";
        Response.Cookies["aa"].Expires = DateTime.Now.AddDays(1);
    }

Open in new window

0

ASP.NET

123K

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