[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

ASP.NET

124K

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

Hi,
I want to show the fields within area like the below rectangle. How to adjust the web page having such details?

32z.png
0
Learn SQL Server Core 2016
LVL 12
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

I have an aspx page with some input controls , along with an user control  ( see sample below).
I have some input in default.aspx page and some more in ascx page.

when I submit the form in default aspx page, I want to read the input values in that user entered in ascx page as well and save those along with the form values in the aspx page.
how can i save the input values from both default.aspx page and ascx control, all at once  ?

Default.aspx page ---

<%@ Register Src="~/WebUser.ascx" TagPrefix="uc1" TagName="WebUser" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
   
    <div class="row">
        <div class="col-md-6">
            <label>default text box</label>
             <asp:TextBox ID="txtusername" runat="server" ></asp:TextBox>
        </div>
      <div class="col-md-6">
          <uc1:WebUser runat="server" id="WebUser" />
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <asp:Button ID="savbtn" runat="server" text="save" OnClick="savbtn_Click"/>
        </div>
    </div>
</asp:Content>

WebUser.ascx page

<asp:textbox id="useremail" runat="server>
0
Iframe on a ASP.net Master page is giving me an error when I set to the Src property dynamically.

I have a website where the Master page has a Iframe defined. The idea is when ever the user choose a menu option, the  asp.net page to be open is set to the SRC property in the back end of the Master page file.

In the code behind, i am setting the value as follows:
    iMainFrame.Attributes.Add("Src", "http://www.google.com")

I am getting an error "Object reference not set to an instance of an object."

This issue happens only when I am using Master page and it works fine for a asp.net page with a Master file.

Any help is greatly appreciated.

Below is the master page definition.

   <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div>
           
              <asp:ContentPlaceHolder ID="MainContent" runat="server">
               
                     <iframe id="iMainFrame" src="SearchBuddy.aspx" style="border:none;width:100%;height:2200px;" runat="server" visible="true"></iframe>
                 </asp:ContentPlaceHolder>
       
           
        </div>

 
    </form>
0
Hi

I want to use CSS styles in my ASP.net web app to style menus, gridviews, textboxes and dropdownlists.

Should I use a professional to do this or are there websites that provide help with this?


Thanks
0
Hello,
I am currently having problems running my application (www.stored-passwords.com) using ASP.net with Visual Basic 2017.
The web.config file contains the following:
<appSettings>
    <add key="SecureAppPath" value="https://www.stored-passwords.com"/>
</appSettings>
The code that retrieves the secure application path from the web.config file.
Dim sURL As String
 sURL = "https:" & ConfigurationManager.AppSettings("SecureAppPath") & "Default.aspx"
 Response.Redirect(sURL)

Everytime I try to run this app an exception is thrown.
Could someone please help?
web.config.txt
Default.txt
0
Hello
I am working with ASP.NET MVC C# (vs.net 2015), trying to create a date picker in my view. I have got the following error message
"0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'datepicker'"

I made sure to include the proper jquery files in my project main layout page, but did not help.


    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />


    <script src="~/Scripts/jquery-3.3.1.min.js"></script>
    @*<script src="~/Scripts/jquery-3.3.1.js"></script>*@
    <script src="~/Scripts/MicrosoftAjax.js"></script>
    <script src="~/Scripts/MicrosoftMvcAjax.js"></script>
-------------------------------------------------------------------------------------------------------------
and here some of my code from my create.cshtml page

      <script type="text/javascript">

          $(function () {
             
                  $("#inventoryID_date").datepicker();
         
          });

      </script>

    <div class="col-sm-1">
                    Inventory Date
                </div>
                <div class="col-sm-2">

                    @Html.EditorFor(model => model.INVENTORY_DATE, new { @id="inventoryID_date" })
                    @Html.ValidationMessageFor(model => model.INVENTORY_DATE, "", new { @class = "text-danger" })


                </div>

thanks,
Mubarak
0
I have developed a website (https://inbranchcardprinting.azurewebsites.net) that my credit union will be using to upload a picture from a members phone to our Azure storage blob that will be printed onto their custom debit card. The main issue is right after the upload page (and before the thank you page just fine while exiting that action fine) Safari will display one of two error messages.
The first and most common one is "This web page has been reloaded because a problem has occurred." Sometimes this is accompanied by a dialog box asking to resubmit the form.
However, everything on the back end worked fine. No server side errors were thrown and the image is successfully uploaded to our azure storage. I step through the controller and everything works fine and exits the action with no issue. This problem does not occur on desktop or Android devices.

Now I know that I can reproduce the bug so I look into how to diagnose iOS safari pages and tried to use their Web Inspector tool. I get it loaded up on my Mac just fine and tethered my iPhone to the Safari session. I go to the page and not only does it error on my iOS device it crashes my Mac's Safari window of debugging. So next I try to use Xcode's Simulator and system logging to capture the issue, and nearly the same thing happens only I get an on screen(simulator) error of "This page can not be loaded because the web page stopped responding." This doesn't crash the Simulator, but the logger window did not record …
0
Hi
I have built an ASP.net web application that I need design help with. I don't want to share my entire project with a cuss designer but rather give him just enough access to see my mark up code.
I have never done this before so am looking for advice on the best way to do this.
Is there a way in Visual Studio 2017 to collaborate in this way?
0
Hi,

We have 2 applications and would like a user to switch to one them securely, so the user will login (with username and password) to one Site A and then click on a link to navigate to the Site B. If I checked that the user is coming from Site A (referring site and page) would this be enough to ensure this is safe or should I make more checks?

Any recommendations would be helpful.

Regards,
0
I hope somoene can help me with this. This is my second day trying to figure this issue and I'm close to banging my head against my soft cube wall :)

I'll go step by step. I've created a sample code to show it. You can copy and paste it in VS2017 and run it. Call Test() method

1. This is the sample code
 public class LogicOperatorTest
	    {
		    public LogicOperatorTest(bool isAll = false)
		    {
			    IsNumeric = IsString = IsDate = IsBool = IsObject = isAll;
			    EnableValueField = true;
		    }

		    public string Key { get; set; }
		    public string Name { get; set; }
		    public bool IsNumeric { get; set; }
		    public bool IsString { get; set; }
		    public bool IsDate { get; set; }
		    public bool IsBool { get; set; }

		    public bool IsObject { get; set; }
		    public bool EnableValueField { get; set; }

		    //public bool Selected { get; set; } //
		    public string DataType { get; set; }//
		    public string ClassStringBuilder { get; set; }//
		    public string DisplayStyle { get; set; }//
		    
	    }
		private void Test()
	    {
		    var sb1 = new System.Text.StringBuilder();
		    var classStringBuilder = new System.Text.StringBuilder();

		    List<List<LogicOperatorTest>> myList = new List<List<LogicOperatorTest>>();

		    List<string> FilterFieldKeys = new List<string>(new string[] { "27", "18"});
		    List<string> FilterOperators = new List<string>(new string[] { "gt", "nc" });
		    List<string> filterField = new 

Open in new window

0
PMI ACP® Project Management
LVL 12
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

I want send mail from a asp.net application. My question is: which is the best approach to this?
0
I have an ASP.net web application that connects to the SQL server.

I wish to deploy the application along with the database for a customer. But I do not want them to see the procedures or table objects of the database. I do i restrict them.

I have seem some deployed database application where the procedure name are using some naming convention which seems like some auto program is converting them. I am not sure if my finding is correct.

I use the ASP.net web deployment kits for my ASP.net web application which work find that it compiled the web site. Only thing is that I need to deploy by copying the files.

So, I am looking for some one to share their experience in deploying web application with the database.

Thank you in advance.
0
My MVC app works great locally, but when i publish into a virtual directory it calls the wrong path
I.e.  instead of  
Localhost/virtual/Home/PlotProbeData
it calls
Localhost/Home/PlotProbeData

Here is the piece of code in question

 
$.getJSON("/../Home/PlotProbeData", { probe: probeData }, function (data) {

Open in new window


i've looked online and it suggests using url.content or url.action, but what I tried doesn't seem to work

the above code exists inside the cshtml file.
0
Hi, I'm trying to delete all the children divs that I created dynamically in a parent div. The parent div contains different controls, not just divs.

 var imgContainer = document.getElementById("ContentPlaceHolder1_div_Container");
    var childDivs = imgContainer.getElementsByTagName("div");

    var NumberOfDivs = childDivs.length;

    for (i = 0; i < NumberOfDivs; i++) {
        imgContainer.removeChild(childDivs[i]);
    }

Open in new window


If there is only one child div, the code works fine. However, when I append multiple divs I get the following error

"JavaScript runtime error: No such interface supported"

Any ideas?

Thanks
0
When styling a website, when we set style on a body or html element , as below. will this override style for all the inputs as well?


body{
   font-size : 12px;
   font-family: sans-serif;
}

or like this

* {
      font-size : 12px;
      font-family: sans-serif;
    }
0
Hi Experts,

I'm trying to connect to a Access DB in order to sanitize some data using PHP. I Have already enabled by PHP PDO ODBC driver  (uncomment the extension=php_pdo_odbc.dll line in php.ini) and restarted my IIS.

I get the following code...
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] SQLDriverConnect: 63 [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0x14b8 Thread 0x11e4 DBC 0x22f8444 Jet'.' in C:\inetpub\wwwroot\DICE-AccessNOC\includes\access_db.php:18 Stack trace: #0 C:\inetpub\wwwroot\DICE-AccessNOC\includes\access_db.php(18): PDO->__construct('odbc:Driver={Mi...') #1 C:\inetpub\wwwroot\DICE-AccessNOC\find-distinct.php(6): Access_DB::getDB() #2 {main} thrown in C:\inetpub\wwwroot\DICE-AccessNOC\includes\access_db.php on line 18

Open in new window


My includes/access_db.php is
<?php

$TBL = "TBL_DICE_Factorial_Analysis";

class Access_DB{
 
    private static $db;
    
    private function __construct() { } //no new objects can be created
    
    public static function getDB() {    
    
        $access_path = "Z:\\Business\\CLIENTS\\DICE Assessment\\Received Files\\NOC_Database_Backup_2_PHPCopy.accdb";
         
        //One connection per browser session
        if (!isset($db)) {
            $dsn = "odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)}; Dbq=$access_path;";
            self::$db = new PDO($dsn);
        }
        return self::$db;
    }
    
    public function __destruct() {

        self::$db->close();
        
    }
}

function print_variable($var, $label = '', $raw = true){

    echo '<br>=========START=========<br>';
    echo '<b>' . $label . '</b>';

    if ($raw == true) echo '<pre>';

    print_r($var);

    if ($raw == true) echo '</pre>';
    echo '<br>=========END=========<br>';
}
?>

Open in new window


The caller is
<?php
    require_once 'includes/access_db.php';
    
    $query = "SELECT * FROM $TBL ORDER  BY NOC_Code, NOC_Occupation; ";

    $db = Access_DB::getDB();

    $statement = $db->prepare($query);
    $statement->execute();
    $rows = $statement->fetchAll(PDO::FETCH_ASSOC);
    $statement->closeCursor();

    print_variable($rows, 'Fact Analysis');
?>

Open in new window


I have also given full permissions to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC and its children to IIS_IUSRS, but the issue persists.

I'm also posting this under ASP, as I see on Google, this also occurs under ASP.

Any help will be greatly appreciated.
0
How do I extract parent values and all child values from deserialized JSON, one record per child value, to a List<T>?

Sample JSON:  json_sample.txt

So from the attached sample JSON we wish to add the following records to the  list:
Record 1:  aen: Y456789, studentID: 1016, need: MMM, rank: 1
Record 2:  aen: Y456789, studentID: 1016, need: PPP, rank: 2

All records with "needs : null" to be ignored and all "need": "Not Specified" to be ignored. Sample code below:



      CTFNeedDataBatch =
                           (from people in myJSON.content
                            select new NeedCTF
                            {
                                studID = people.StudentBasic.studentId.ToString(),
                                AEN= people.StudentBasic.aen.ToString(),
                                Code = (people.StudentSensitive.needs == null ? people.StudentSensitive.needs[0].need.ToString() : ""),
                                Priority = (people.StudentSensitive.needs == null ? people.StudentSensitive.needs[0].rank.ToString() : ""),
                            }).Where(w => w.Code != "").ToList();


The problem with this code is we are not getting any values from the "needs" element and even if we were, I doubt we would be getting more than one record from an element that has more than one need.
0
Hi, I'm using  jquery (3.1.1), in my ASP.NET app,  but it gives me the the following error when I try to execute the function below...

"0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'ajax'"

 <script src="Scripts/jquery-3.1.1.min.js"></script>

 function InsertTest(mark) {
            $.ajax({
                        type: "POST",
                        data: param,
               
                        url: "/default.aspx/TestMe",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        data: JSON.stringify({ 'param': param}),
                
                    });
        };

Open in new window


Any ideas??
Thanks!
0
Hi,

I am working on Asp.Net Application to develop business application. All screes/forms built as UserControl(.ascx) and set as embedded resource. I am using the LoadControl()
Method to open these controls using registered VirtualPathProvider. Every UserControl have two local resource files (.resx) for Arabic and English.
My problem: The UserControls Loaded successfully but without any text, there is no text on buttons and labels,...

I attached a small project MyControls.rar to produce my problem. the webusercontrol contain single button, I need to show the text on the button.

Thank you for all
0
Fundamentals of JavaScript
LVL 12
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Actually i have a requirement like for example I have a login page and i have logged in,

now while clicking logout button  i have to do some database updation and suddenly without clicking the logout button if the user

closes the window no updation will take place.

How to detect the browser close event in ASP.Net (C#) . aspx.cs file
0
I have few icons and images in svg format, that I need to untilize in asp.net site.
I added all the svg icons in an image tag as such

<img src=".../icon.svg>

this way I can't set the color of the svg icon. as there are quite a few icons , i'm using , what would be a best approach  to use such svg icons , so that i can set the color as well.
0
I have an asp:FileUpload control in my aspx page.
to override the default style, I put the control inside a label and make the control hidden. also I add an image , so that when user clicks on it, they will be able to upload the file.
as the file upload is hidden, the default behavior is also hidden , that is

when a file is selected , the name of the file is displayed next to this control .
when no file is selected , the text  "no file chosen" is  displayed next to the control.

How can i display those messages , when I want to style the asp:fileupload?

aspx page -----------------------

<label  class="upload">
  <asp: FileUpload id="uploadfile" ... style="display:none" > 
  <img sre=".." > 
</label>

css  -->
.upload{
  background-color: gray;
}
0
say, when there is a label/span/anchor next to an image/icon , what is the best way them to align them vertically, so that both are centered vertically.
for example , I have anchor tag and a input type of button next to each other in a div, like below, how can i align them vertically centered?

<div>
    <a href="" ...>
     <input type =button....>
</div>
0
I cannot get HttpContext to work in ASP.NET Core.


 public string GetCartId()
        {
            if (HttpContext.Current.Session[CartSessionKey] == null)
            {
                if (!string.IsNullOrWhiteSpace(HttpContext.Current.User.Identity.Name))
                {
                    HttpContext.Current.Session[CartSessionKey] = HttpContext.Current.User.Identity.Name;
                }
                else
                {
                    // Generate a new random GUID using System.Guid class.     
                    Guid tempCartId = Guid.NewGuid();
                    HttpContext.Current.Session[CartSessionKey] = tempCartId.ToString();
                }
            }
            return HttpContext.Current.Session[CartSessionKey].ToString();
        }

Open in new window

 Visual Studio keeps coming back with red squiggly lines under the words HttpContext and the Error message "The name 'HttpContext' does not exist in the current context."

As a bit of background, I'm making two big leaps at once: (a) trying ASP.NET Core for the first time and (b) trying to use C# for the first time after years of just VB/asp.net.  I like a challenge!  To help get me there, I'm using a few online guides:
Getting Started with EF Core on ASP.NET Core with an Existing Database
and
ASP.NET Shopping Cart

In effect, I've followed the first link through from starting a blank project to setting up database CRUD pages and tested - all good.  However, when I insert the shopping basket page from the second link, it errors on anything HttpContext related.

In an attempt to fix this, I've followed the suggestions on  ASP.Net Core Session State, added the relevant code hightighted in yellow for the startup.cs page - but to no avail.
0
Hi I am using comcast server for email on Asp.net, I am facing issue while sending email, What is happening is when I am setting from-address of different email domain then its failing and throwing error :

Transaction failed. The server response was: 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message
due to a permanent exception with message Cannot submit message. 16.55847:301D0000, 17.43559:0000000094000000000000000200000000000000,
20.52176:140FCC841400101038020000, 20.50032:140FCC848417101044020000, 0.35180:02011330, 255.23226:5A020000, 255.27962:0A000000, 255.27962:0E000000,
255.31418:0201E165, 16.55847:9C000000, 17.43559:0000000068010000000000000100000000000000, 20.52176:140FCC84140010100B002900,
20.50032:140FCC848417101003003600, 0.35180:C9000000, 255.23226:0A004100, 255.27962:0A000000, 255.27962:32000000, 255.17082:DC040000, 0.27745:0A006400,
4.21921:DC040000, 255.27962:FA000000, 255.1494:E9000000, 0.37692:01000100, 0.37948:01000100, 5.33852:00000000534D545000000100, 4.56248:DC040000,
7.40748:010000000000010B01000100, 7.57132:000000000000000000000000, 1.63016:32000000, 4.39640:DC040000, 8.45434:BADA3CA85AC1194EB5D80A8D8905B0EB45004338, 5.10786:0000000031352E32302E313232382E3032303A435934...


If I setup Comcast Username as From-User then it works fine, How i can fix that? Please help
0

ASP.NET

124K

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