[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

ASP.NET - I am looking for recommendations on a good popup window control which can use something like CSS, jquery, or javascript.

I don't have a problem with using codecanyon, but it's so hard to find what is good versus bad out there.

So please recommend something, free or for reasonable purchase, that works well.

I am not interested in using Telerik or AjaxControl Toolkit.

Thanks!
0
Become a Certified Penetration Testing Engineer
LVL 12
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

ASP.NET - I would like recommendations for a good Bulk Upload Panel with drag and drop, or click to select from the file system. It can use something like CSS, jquery, or javascript.

I don't have a problem with using codecanyon, but it's so hard to find what is good versus bad out there.

So please recommend something, free or for reasonable purchase, that works well.

It needs to have ability to drag, click, designate allowed file types, and of course when it is done, it should be in byte form or something so I can store it in a varbinary field in my table. If it only allows saving to the hard drive, that won't work. During upload, there should be a progress bar.

I am not looking for Telerik or http://www.ajaxcontroltoolkit.net/AjaxFileUpload/AjaxFileUpload.aspx

Thanks!
0
I have two gridviews in my asp.net application, a parent one and also a child gridview. I am able to bind data to each of these gridviews correctly, but I have been unable to figure out how to get the different events for the child gridview to work. In specific, I need to use the child gridview's rowdatabound event, but I can't seem to figure out how to. I have tried using the following syntax to start the sub:

Protected Sub GridView2_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView2.RowDataBound

This however shows up as an error saying that the "handles clause requires a withevents variable defined in the containing type or one of its base types. I have also tried eliminating the handles part of the syntax and tried to call the code with an "OnRowDataBound" property in the view.ascx of my webpage. This never fires any events.

Thank you for any help or guidance you can offer.

Protected Sub GridView2_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView2.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim label1 As Label = TryCast(e.Row.FindControl("Label1"), Label)
            label1.Text = "this works"
        End If
End Sub

Open in new window

0
How to stop the scroll when it reaches the last image in the folder?
 <ul id="carousel" class="jcarousel jcarousel-skin-tango">
				<li><a href="#" rel="p1"><img src="images/small/1.jpg" ></a></li>
				<li><a href="#" rel="p2"><img src="images/small/2.jpg" ></a></li>
				<li><a href="#" rel="p3"><img src="images/small/3.jpg" ></a></li>
				<li><a href="#" rel="p4"><img src="images/small/4.jpg"></a></li>
	            <li><a href="#" rel="p5"><img src="images/small/5.jpg" ></a></li>
				
			  </ul>
		

Open in new window

0
I'm using ASP.NET Web Forms and VB

On my page I have a ASP TextBox and a ASP Button

I'm using the TextChanged event for the textbox.

This is my working code for my page

ASP_TextBox_TextChanged4.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ASP_TextBox_TextChanged4.aspx.vb" Inherits="ASP_TextBox_TextChanged4" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table>
            <tr>
                <td></td>
                <td><asp:TextBox ID="TextBox1" runat="server" ontextchanged="TextBox1_TextChanged" Text="This is a test"> </asp:TextBox></td>
            </tr>
            <tr>
                <td></td>
                <td><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>
            </tr>
            <tr>
                <td></td>
                <td><asp:Button ID="Button1" runat="server" Text="Button" /></td>
            </tr>
        </table>
    </div>
        <asp:HiddenField ID="HiddenField1" runat="server" />
    </form>
</body>
</html>

Open in new window


ASP_TextBox_TextChanged4.aspx.vb

Partial Class ASP_TextBox_TextChanged4
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    'TextBox.TextChanged Event
    ' Occurs when the content of the text box changes between posts to the server.
    

Open in new window

0
Razor# MVC

I have a javascript function that is called when a drop down is changed. this function calls a code behind function in the controller. the problem is the js function does not wait for the function to run, it never calls success or error. Once the java script function exists then the function called in the code behind runs.

Can anyone advise on how to make the javascript function wait while the code behind function is called and returns?

Javascript
function toggleDIvDisplay(e) {
        debugger;
        var result;
        $.ajax({
            type: "POST",
            url: '@Url.Action("FleetSelect", "Reports")',
            data: "{'value':'" + e + "'}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (data) {
                result = data;
                if (data == "OK") {

                }
            },
             error: function () {
                alert("Failed to load Item");
            }
        });

        if (result == "123") {
            $('#divtwo').show();
        }
        else {
            @* $('#divtwo').hide(); *@
        }
    }

Open in new window



Code behind controller
 public JsonResult FleetSelect(string value)
        {
            List<ReportType> rList = GetReportList();
            foreach (ReportType rt in rList)
            {
                if (rt.id == Convert.ToInt32(value))
                {
                    if (rt.vehicle)
                    {
                        return new JsonResult { Data = "V" }; 
                    }
                    else
                    {
                        return new JsonResult { Data = "F" };
                    }
                }
            }
            return new JsonResult { Data = "V" };
        }

Open in new window

0
We create VMs with the latest build of our code on. One VM has a weird ASYNC_NETWORK_IO error when running a SQL SELECT statement. It isn't on any other VM.

I have tried googling for the error - clearly something failed to start or get set when this VM was created.

Just for peace of mind it would be really useful to know what might be the cause of this and if there is some setting I can adjust to fix it.

The symptom is that a SQL SELECT statement just seems to time out with this ASYNC_NETWORK_IO error, but the strange thing is that it must have somehow returned some results because it then blocks an INSERT statement that has used the results of the SELECT statement.

Everything necessary for the application is on the VM - the ASP.NET application and the SQL Server database so there is no actual network access outside of the VM.

There is no antivirus running on the VM either which is one possibly cause I came across.

The server is Windows Server 2016 and the SQL Server is 2016 also.

I've attached a picture of what is happening.

Just to repeat this doesn't occur on any other VMs with the same software on.

I have tried restarting IIS and restarting the VM.

The VM is Hyper-V.

ASYNC_NETWORK_IO error
0
dear all

i have a solution that contains 2 project (virtaul directories) ex
Solution1
        Project1
            USerControls
                      uc_Time.ascx
       Project2
            Default.aspx


how can i refer from a project a user control located in another project in the same solution
in my case i need in default.aspx page to use a user control uc_time located in project 1
Kindly advise.
thank you
0
We have a number of users that work remotely. Lately, they have been experiencing a large lag when trying to run in house developed .aspx pages.

This appears in multiple ways: 1) taking multiple seconds for letters to appear when typing and 2) taking lots of time for data in a dropdown list to appear.

I have tried all of the normal fixes with no luck. Examples:

-Problem happens in different web browsers.
-Problem happens when the remote users are in the office connected via cable or when they are using WiFi remotely.
-All other users are having no problems with the application.

Any other suggestions?
0
This works but I wonder if there's another way of writing foreach. If not, I'll keep what I have

var nn = q.Select(x => x.Schedule); //scheudles that don't have authusers attached to them
var p = CurrentContext.Schedules.Select(x => x.AuthUsers.Where(u=> u.ID == user.ID)).ToList(); //list all schedules and their authusers

	foreach (var row in p)
	  {
		foreach (var s in row)
		  {
		    if (s.ID == 72)
			{
				//var f = s.Schedules;
				//var t = f.Select(x => x.AuthUsers);authuser for the schedule

				foreach (var ss in nn)
				{
						
				  var schedId = s.ID;
				  ss.AuthUsers.Add(new AuthUser()
					{
						ID = s.ID
					});
	}
	   }

Open in new window

0
CompTIA Cloud+
LVL 12
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Hi;
here is my story
--Total Record -- 5000 records  
---Bringing Data from Database using lambda expression....
var dtTable = objHRContext.BscTbls.Select(X => X ).ToList ();  

Open in new window

 
--it takes 0 second bringing data from database.....
--binding  Data to gridview  with DataTable it takes 10 seconds... Here is my problem
 
 gvData.DataSource = dtTable;
  gvData.DataBind();

Open in new window

--Here is  my GridView Design view

 <asp:GridView ID="gv_EmpList"   runat="server" AutoGenerateColumns="False"
                    class="table table-striped" Width="100%">
                    <Columns>
                      
                        <asp:BoundField DataField="BscName" ItemStyle-Wrap ="true" HeaderStyle-Wrap ="true"  HeaderText="الاسم" />
                        <asp:BoundField DataField="RankDescription" HeaderStyle-Wrap ="true" HeaderText="grade" />
                        <asp:BoundField DataField="BscRank_Type_Desc" HeaderStyle-Wrap ="true" HeaderText="grade type" />
                         <asp:BoundField DataField="Unit_Name" ItemStyle-CssClass ="styleDisPlay" HeaderStyle-CssClass ="styleDisPlay" HeaderStyle-Wrap ="true" HeaderText=" grade type " />
                        <asp:BoundField DataField="BscNo" HeaderStyle-Wrap ="true"  HeaderText="emp number" />
                        <asp:BoundField DataField="LastPromDate" HeaderStyle-Wrap ="true" HeaderText="promotion date" />
                        <asp:BoundField DataField="Billet_Name" 

Open in new window

0
I have an <asp:label id="brandName" runat="server"/> in my aspx page in an asp.net website.

in the cs page, i populate the text of this label , depending on certain value .

   if( somecondition) {
       brandName.Text = "somebrandname" ;
   }
   else {
           brandName.Text = "someOtherName" ;
    }
   

I want to add trademark (TM) at the end of the brandname text .

how can i do this?
0
Is React the right technology for me to learn right now?

I am a C#.NET Full Stack developer with some experience in Angular 4.

I've been out of the job market for 9 months as I worked on private projects only tangentially related to web development and social media. But the next job could be me back as a
software engineer or a Sr. Software Engineer, my usual title.

I feel that React is key. What are your thoughts?

How hard might it be for me to do a crash course in React?

What are some good training sites for that?

Thanks.
0
I hope someone can help me with this. Been at this all afternoon. I'l go step by step.

1. I have a table Schedule and AuthUsersSchedule.  For each Schedule row, we can have one or more users in AuthUsersSchedule. There's a FK relationship. Looks like this.
s1.png
s2.png
2. There's an EDMX. I see the Scheudle table in it but the AuthUsersSchedule is a navgiation property. In the code, I can't do dbcontext.AuthUsersSchedule. Looks like this

s3
3. I have a stored proc and I get the Schedules

var param = new SqlParameter() { ParameterName = "searchtext", Value = string.Concat('%',searchText,'%') };
var result = CurrentContext.Database.SqlQuery<SearchAssetModel>("[dbo].[usp_SearchAssets] @searchtext", param).ToList(); 

Open in new window


4. I populate the Scheudle like this

 Schedule = new Schedule()
			  {
				 ID = c.ScheduleId,
				 Sched = c.Sched,
				 MasterLeaseID = c.MasterLeaseID,
                                ......

Open in new window


But how do I populate AuthUsers? How do say.... give all the users in AuthUserSchedule with AuthUserSchedule.ScheduleId = Scheudle.Id.  I did this and getting errors

 Schedule = new Schedule()
			  {
				 ID = c.ScheduleId,
				 Sched = c.Sched,
				 MasterLeaseID = c.MasterLeaseID,
                                ......,
                                 AuthUsers = new AuthUser()
				  {

				 }

Open in new window


s4.png
If it helps, this is the entire code section that I populate Schedule




Open in new window

0
I'm using ASP.NET Web Forms.

In a ASP TextBox that holds a string, how do i check if a user typed in the textbox?
Sometimes the textbox might contain a string already on page load. I'm not checking if the textbox is empty.
I want to check if the user typed anything in the textbox.


So on button click if they user typed anything in the textbox

Then set this variable CheckTextBoxTyped = "Yes"

If nothing was typed in the texbox set this variable CheckTextBoxTyped = "No"


Right now i have this:



    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    Dim CheckTextBoxTyped As String

    CheckTextBoxTyped = "Yes"


    CheckTextBoxTyped = "No"

    End Sub
0
Of course, this can't be that hard but I don't know what the project I'm adding is not becoming part of the solution.

I go step by step with screenshots

1. I added a Class Library to the solution. I right clicked on the solution to add it
p1.png
2. I got this message but I clicked Continue
p2.png
3. I saw it in solution and added a reference to it to another project in the solution

p3.png
4. Then I wanted to use the namespace but code couldn't find it
p4.png
5. I went digging in to see what's going on. Read it might be resharper so cleared the cache. Removed the reference, added it back. Compared it with another reference that's added. Then, I opened the project in notepad and saw the path is different You see ..\..\ compared to ..\

<ItemGroup>
    <ProjectReference Include="..\..\CSI.MYxyz.ViewModels\CSI.Myxyz.ViewModels.csproj">
      <Project>{f34226c8-0718-4fdf-a9e1-217e7334b1f3}</Project>
      <Name>CSI.Myxyz.ViewModels</Name>
    </ProjectReference>
    <ProjectReference Include="..\CSI.Myxyz.Shared\CSI.Myxyz.Shared.csproj">
      <Project>{2B09F5F9-AA55-4704-B32F-42F5BFCBD3A7}</Project>
      <Name>CSI.Myxyz.Shared</Name>
    </ProjectReference>
  </ItemGroup>

Open in new window


6. I see all the projects in the solution
p5.png
7. When I look at the Windows Exploere, the project I added it is not there. It's somewhere else. I wonder if this is the cause of my problem for step 4. Why isn't this newly added project where it should be...listed with all other projects? What am I missing? Why can't I reference this namespace? I doubt the location of the project is the reason why I can't reference that namespace

It's not here
p6.png
It's listed in the root

p7.png
0
1. I want to add the compare checkbox under the item. When user checks the checkbox, the image will be added to the bottom  of the comparing area. The following code does not work. Please advise!
2. How to add the Compare link to the comparing area, which will be linked to the page with the four compared products. Click each product and then linked to the product page.  

Thank you!
<%@ Page Language="VB" %>

<script language="vb" runat="server">

Sub Page_Load(sender As Object, e As EventArgs)
Dim strSQL
		
 	-------------
					
</script>

<style>
.empty-border {
  padding-bottom: 100%;
  border: 1px dashed #9c9c9c;
}

#compare-box-products {
  box-shadow: 0 1px 2px 2px rgba(0, 0, 0, .2);
  background-color: #fff;
  position: fixed;
  right: 0;
  bottom: 0;
  width: 558px;
  padding: 10px;
  pointer-events: all;
  display: none;
}

.empty-border {
  width: 110px;
  height: 110px;
}

.compare-image-container img {
  width: 108px !important;
  height: 108px !important;
  border: 1px dashed #9c9c9c;
}


</style>


 
 
<body >










<div class ="grid-top-spa"><asp:Label runat="server" ID="lblMessage" /> </div>

 <asp:DataList ID="compare"
									           CellPadding="0"
                                               CellSpacing="0"
                                               RepeatDirection="Horizontal"
									           borderstyle= "none"
									           GridLines="None"
									           RepeatLayout="Table"
									           RepeatColumns="3"				

Open in new window

1
1. Two years ago, I worked on a project that used Entity Framework and bindind of the data was to the Entity Framework entities (tables). This wasn't flexible, so the architect moved the ViewModels folder out of the project and created a separate project for it. Doing this, we were able to create ViewModels and reference them in the Data Access layer and bind to the ViewModels and not to the Entity Framework entities.

Example If we had a table called Teachers, instead of doing something like IQuerayble<Teachers> , we created a TeacherViewModel and did IQuerayble<TeacherViewModel>

2. Fast forward to now and I'm working on a project that has the same thing; binding to the EF entities and not to ViewModels. If we want to join, for example to two tables, and bring data from both...then I can't just do IQueryable<Teachers>

 3. I want to make sure the change I'm going to make is correct.
  I see a "Shared" project in the solution and this Shared project is referenced in the Data Access layer. I can add the ViewModels here but I'm wondering if I should create a separate ViewModels project (like what I had in the project from two years ago)

Anyone has had this problem?  Should I create a whole new ViewModel project OR use the existing project? I eventually want to remove all the ViewModel classes from the web project and move them either to the Shared folder (if this is the best way to go) or to the new ViewModels project.

p1.png
0
How to accomplish it per the attached image? Beside the textbox there is a arrow dropdown. When user clicks the arrow, it pulls out two textboxes. After the user enters the value and clicks Apply, the value will go to the textbox. Any simple example?
search.jpg
1
Introduction to R
LVL 12
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

When starting to type in keyword e.g. FUR in the search box,  you will see dropdown list from the textbox  with furniture or fur or something related with fur even with pictures.
How to accomplish it? Thank you!
0
The folder name is labeled by ID. If the idProduct is 3, the folder is 3. In folder 3  there are three images, and in folder 4, there are 2 images, but in folder 6 there are 7 images.  

In the coding as below, the images for idproduct 3 and idproduct 4  will be displayed as X (no images) starting from image 4 and image 3 separately. How to modify the coding?  Thank you!

<ul id="carousel" class="jcarousel jcarousel-skin-tango">
<li><a href="#" rel="p1"><img src="images/small/<%=idProduct%>/1.jpg" /></a></li>
<li><a href="#" rel="p2"><img src="images/small/<%=idProduct%>/2.jpg" ></a></li>
<li><a href="#" rel="p3"><img src="images/small/<%=idProduct%>/3.jpg" ></a></li>
<li><a href="#" rel="p3"><img src="images/small/<%=idProduct%>/4.jpg" ></a></li>
<li><a href="#" rel="p3"><img src="images/small/<%=idProduct%>/5.jpg" ></a></li>
<li><a href="#" rel="p3"><img src="images/small/<%=idProduct%>/6.jpg" ></a></li>
<li><a href="#" rel="p3"><img src="images/small/<%=idProduct%>/7.jpg" ></a></li>

  </ul>

Open in new window

0
Thanks for the expert Zakaria's prompt advice!
I followed his example, but still have some issues.
 It works perfectly if the image is listed individually. When the checkbox is checked, the image is added to the comparing area
 <div class="col-sm-4 col-md-3">
          <div class="thumbnail">
           
 <div class="thumbnail-img">
              <img src="images/1.jpg" width="150" height="150" class="img-p1">
            </div>
           
              <h3>Product 1</h3>
              <p>10 $</p>
              <p><input type="checkbox" class="p1"> Compare Product
              </p>
            </div>
          </div>

Open in new window

But if add to the datalist area, it does not work. When checking the checkbox, it does not do anything.  
<asp:DataList ID="compare"
									           CellPadding="0"
                                               CellSpacing="0"
                                               RepeatDirection="Horizontal"
									           borderstyle= "none"
									           GridLines="None"
									           RepeatLayout="Table"
									           RepeatColumns="3"									          
									           ShowBorder="false"
									           runat="server" HeaderText="" HeaderStyle-BackColor="#fff" HeaderStyle-ForeColor="#FFFFFF" HeaderStyle-Font-Bold="true">

                                   <ItemTemplate>
								   
	
 

<table>
      <tr>
		<td> <a href="products.aspx?id=<%# DataBinder.Eval(Container.DataItem, "idProduct") %>">
   
        <div class="thumbnail"> <div class="thumbnail-img"><img src="images/<%# DataBinder.Eval(Container.DataItem, "idProduct") %>.jpg" class="img-p1"> </div></a>

</td>
	</tr>

 <tr><td><input type="checkbox" class="p1"> Compare Product</td></tr>

Open in new window


Lastly how to add the Compare link to the comparing area, which will be linked to the page with the four compared products. Click each product and then linked to the product page.  Per the attached image.
compare.jpg
0
Hi experts,

I have a .aspx web forms website.

Some users of our site who have an iPhone and are using their web browser on their iPhone get an error. But the error doesn't occurs on every iPhone on some iPhones it works fine.

In this day and age is their a tool you use to test a site so it works ok against all different iOS versions and iPhone web browsers?

In a perfect world I would have an iPhone 6 and iPhone 7 and iPhone 8 and iPhone Xs and launch the web browser on each one to test the site.

But how do you guys test across all mobile platforms?
0
I have an asp.net repeater. I want to search text in the repeater, any text on a row.

I downloaded and installed the jquery.quicksearch.js from github. I hadn't read the part about the project being abandoned and probably wouldn't work. I installed the examples and none of them worked in Chrome.

Can you direct me please to some javascript or jquery or something that searches within a repeater clientside? I don't need to have tables in there, and in fact would prefer not. I just want it to find any of the text that I am searching for and return the row if it does.

thanks!
0
I have a form with a Text Area. I want the text box to automatically be set to display at least 10 rows.

 <div class="col-xs-12">
                        @Html.TextAreaFor(x => x.notes, new
                   {
                       @class = "form-control",
                   })
</div>
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