.NET Programming

132K

Solutions

38K

Contributors

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

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

Sign up to Post

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
Interactive Way of Training for the AWS CSA Exam
Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

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
0
How to I add "or" to the following:

 var recordCount = db.tblWHQReports.Count(a => a.Mgr == employeeid);

??
0
Hi,
Further to this
https://www.experts-exchange.com/questions/29042667/Add-button.html?anchor=a42220705¬ificationFollowed=192653361#a42220705

I adjust the column name in Javascript but the problem persists (I cannot delete the record), after re-deployment.
0
Hi Experts,

I have a page which has a Ajax call to a search function, which is working fine with the search button, which calls it. When I added a function to capture the enter key to trigger the click attribute of the search button, now the the function is firing, pulls back the correct search records for a flash, but then the page completely reloads with the original value of the page. What I'm not understanding is how the default value of the page is loading, since it's not hitting the database call again. Any ideas?

Thanks,
Steve
0
Hello,
How to export a datable as a url. The displayed web form should have the datatable in the form of a table.
 Thanks
0
Hello,
How can I connect to a stored procedure and display its content on a web page which is desktop/ mobile friendly in a tabular form.
Regards
0
Hello.

I have a VB application that calls an external dll for address verification.  I need to add this code to a C# application but my conversion of the code is not being accepted.

VB6 code:

Declare Function UNZ_INIT_EX Lib "UNZDLL32.DLL" () As Long
Declare Function UNZ_TERM Lib "UNZDLL32.DLL" (ByVal hUnz As Long) As Long
Declare Function UNZ_CHECKADDRESS Lib "UNZDLL32.DLL" (ByVal hUnz As Long, ByVal Line1$, ByVal line2$, ByVal line3$, ByVal Line4$) As Long
Declare Sub UNZ_GETSTDADDRESS Lib "UNZDLL32.DLL" (ByVal hUnz As Long, ByVal szFirmName As String, ByVal szPRUrb As String, ByVal szDelLine As String, ByVal szLastLine As String)
Declare Sub UNZ_GETERRORTEXT Lib "UNZDLL32.DLL" (ByVal hUnz As Long, ByVal ErrorText As String)
Declare Function UNZ_GETMATCHCOUNT Lib "UNZDLL32.DLL" (ByVal hUnz As Long) As Long
Declare Sub UNZ_GETMATCHADDR Lib "UNZDLL32.DLL" (ByVal hUnz As Long, ByVal intItem As Integer, ByVal szFirmName As String, ByVal szPRUrb As String, ByVal szDelLine As String, ByVal szLastLine As String)
Declare Sub UNZ_GETAREACODE Lib "UNZDLL32.DLL" (ByVal hUnz As Long, ByVal szAreaCode As String)

C# code:

using System.Runtime.InteropServices;
[DllImport("unzdll32.dll", CharSet.Auto)]

And I started doing this:

public static extern long UNZ_INIT_EX();
public static extern long UNZ_TERM(long hUnz);

But, VS2017 doesn't like it.

Thoughts?  Thanks. :)
0
Hello Experts,
We have this very small visual basic .net application that has been working ok for years.
now all of a sudden we get the error


System.Runtime.InteropServices.COMException: 'Unknown error.'

when executing the
Private Sub InitializeComponent()
   ...
  ....
 ....
        Me.Text = "test Web Browser"
        Me.GroupBox1.ResumeLayout(False)
        Me.GroupBox1.PerformLayout()
        CType(Me.wb, System.ComponentModel.ISupportInitialize).EndInit()  <<< <<<<<<<<<<<<<<<<<<<<<<here
        Me.ResumeLayout(False)   ' DEBUG
        Me.PerformLayout()
end sub

this has never been a problem,
Please your advice on this
0
Salesforce Made Easy to Use
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Hello,
I have a code which works perfectly to find and replace but, how can I avoid repetition.
  Dim FindObject As Word.Find = oDoc.Content.Find
            With FindObject
                .ClearFormatting()
                .Text = "«" & "Dr" & "*»"
                .Replacement.ClearFormatting()
                .Replacement.Text = ""
                .Forward = True
                .Format = False
                .MatchCase = False
                .MatchWholeWord = False
                .MatchWildcards = True
                .MatchSoundsLike = False
                .MatchAllWordForms = False '
                .Execute(Replace:=Word.WdReplace.wdReplaceAll)
            End With

            With FindObject
                .ClearFormatting()
                .Text = "«" & "Mo" & "*»"
                .Replacement.ClearFormatting()
                .Replacement.Text = ""
                .Forward = True
                .Format = False
                .MatchCase = False
                .MatchWholeWord = False
                .MatchWildcards = True
                .MatchSoundsLike = False
                .MatchAllWordForms = False '
                .Execute(Replace:=Word.WdReplace.wdReplaceAll)
            End With
            With FindObject
                .ClearFormatting()
                .Text = "«" & "Ve" & "*»"
                .Replacement.ClearFormatting()
                .Replacement.Text = ""
                .Forward = True
                .Format = False
           

Open in new window

0
I have passed string from vb variable to crystalReport TextObject, and when i create a formula and browse for that TextObject to calculate ,it's not available to calculate, how can this done?

Thanks in advance.
0
I have been watching these videos:
https://mva.microsoft.com/en-US/training-courses/testing-in-visual-studio-2015-16459?l=iIYJ0ewXC_9506218965

The videos refer to several tools, that are not free.

I was wondering what other free tools are out there that can do the same job as the ones described in the video:
- Exploratory testing and registering test cases and bugs directly with screenshots, action logs and video capture.
- Load testing
- Web performance testing
- Automated UI testing.
- Similar solution to Microsoft Test Manager

My projects are in ASP .Net MVC with C# as backend, and the tools suggested need to work with that technology.
0
In my .net c# project I have two jason like this

Json1
{"WindowsServices":[{"name":"SNMP","statusID":"1","StatusMsg":"Stopped","FullStatus":"SNMP,1"},{"name":"SNMPTRAP","statusID":"1","StatusMsg":"Stopped","FullStatus":"SNMPTRAP,1"}]}

Open in new window


Json2
{"WindowsServices":[{"name":"SNMP","statusID":"4","StatusMsg":"Running","FullStatus":"SNMP,4"},{"name":"SNMPTRAP","statusID":"1","StatusMsg":"Stopped","FullStatus":"SNMPTRAP,1"}]}

Open in new window


I need to compare this to json and get the result of the modified part oly
{"WindowsServices":[{"name":"SNMP","statusID":"4","StatusMsg":"Running","FullStatus":"SNMP,4"}]}

Open in new window



Thank you for your help!!
0
How can I add a clickable button event on a text box. I want to be able to have the end user enter information into a text box then have them double click the box and I would use a dynamic sql statement in vb.net to update the database with the info they entered in the text box.
0
Hello,
I am doing a mailmerge and need to find part of a word in the document and the replace the whole word.
Example:

   
            Dim FindObject As Word.Find = oDoc.Content.Find
            With FindObject
                .ClearFormatting()
                .Text = "«" & "Dr" & "*"
                .Replacement.ClearFormatting()
                .Replacement.Text = ""
                .Forward = True
                .Format = False
                .MatchCase = False
                .MatchWholeWord = False
                .MatchWildcards = True
                .MatchSoundsLike = False
                .MatchAllWordForms = False '
                .Execute(Replace:=Word.WdReplace.wdReplaceAll)
            End With

Open in new window


Cheers
0
I have the following code sample. I have an static member in my custom attribute class.
what is a proper way to initialize this member.

1. i'm initializing it using a UNITY dependency resolver, when the member is declared. will this work? or do i need a static constructor.


public class MyAuthorizeAttribute : AuthorizeAttribute {

   public static AuthService authService =  DependencyResolver.Current.GetService<AuthService>(); ;
 
   protected override bool AuthorizeCore (HttpContextBase httpContext) {
        if (httpContext.User.Identity.IsAuthenticated == false)
            return false;
       
       return  authService.IsAuthorized();
   }
}
0
I am seeing double boxes on my web form grid on some fields.
It is definitely the data because If I load the data value into a label  it shows the same way.

vb.Net web forms .Net 4.5
MS SQL Server 2012 database

You can see the boxes below in ALL the email addresses and one of the last names.
How can I trim this?

We have tried LTRIM and RTRIM

And the data is coming in from a service with varname.ToString().Trim()

SP
0
I'm new to, and using Git. I have my remotes/origin branch of "master" that contains all production-ready code.

From "master", I create a new local branch called "Bug Fixes".

When I try to push code changes in Bug Fixes back to "master", I get this error every time:

Error encountered while pushing to the remote repository: Not a valid reference 'origin/master'

Maybe I'm not using this correctly? Can someone please advise?
0
Windows Server 2016: All you need to know
LVL 1
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Hello,
How can i merge excel template with telerik radgrid.
i am using vb.net desktop.

Regards
0
Using EPPLUS - How do I format negative numbers red.  I have no problems doing the #,##0.00 etc. type formatting.
0
Here is my C# class
using Microsoft.SqlServer.Server;
using System.Data.SqlTypes;
using System.Text.RegularExpressions;

namespace ASI.Utilities
{
	public class SqlRegex
	{
		[SqlFunction(Name = "Replace", IsDeterministic = true)]
		public static string Replace(SqlString input, SqlString pattern, SqlString replacement)
		{
			if (input.IsNull || pattern.IsNull || replacement.IsNull)
			{
				return null;
			}

			return Regex.Replace(input.ToString(), pattern.ToString(), replacement.ToString());
		}
	}
}

Open in new window

and here is my SQL
sp_configure 'clr enabled', 1
RECONFIGURE WITH OVERRIDE
GO

CREATE SCHEMA [Regex] AUTHORIZATION [CON5USERROLE]
GO

IF EXISTS (SELECT 1 FROM sys.assemblies WHERE [name] = N'RegexFunctions') 
   DROP ASSEMBLY [RegexFunctions]
GO

CREATE ASSEMBLY [RegexFunctions] FROM 'C:\Temp\T-SQL Regex.dll' WITH PERMISSION_SET = SAFE
GO

CREATE FUNCTION dbo.RegexReplace
(
	@input VARCHAR(4000),
	@pattern VARCHAR(4000),
	@replacement VARCHAR(4000)
)
RETURNS VARCHAR(4000)
AS EXTERNAL NAME
	RegexFunctions.[ASI.Utilities.SqlRegex].Replace
GO

Open in new window

The error message I'm getting says
CREATE FUNCTION for "RegexReplace" failed because T-SQL and CLR types for return value do not match.
Where have I gone wrong?
0
I have a ASP.NET GridView with a column mapped to a boolean. I want do display "Yes"/"No" instead of "True"/"False".
0
I have following tables in sql server. An employee can belong to multiple departments. if i want to find out an employee that belongs to a department say HR and sales by joining employee table and EmployeeDepartment junction table, what kind of join I should use.

employee table :
Id Name
1     sam
2     joe

Department table :
id Name
1     HR
2     Sales  

EmployeeDeparment Junction table
Id Eid Did
1   1     1
2   1     2
0
Example Contrived for the question.
Say, I have a list<string>  of addresses. I check each value to see, if certain conditions meet and if yes, i change the value and save it back to
the list.
I was using a foreach loop, but realized since it returns an enumerator,which is readonly, I  can't modify the list with foreach loop.
now I changed it to for loop.

my question is, is there any other(better) alternative or data structure to use for better performance, if we have to iterate through
millions of addresses.


List<string> addresses = new List<string>();
        addresses .Add("1280 Kenwood ave");
        addresses .Add("14 main st");
        addresses .Add("925 keene road");
        addresses .Add("42 lee street");

            for (int i = 0; i < addresses .Count; i++) {
                var add = addresses[i].ToString(); 

                if (add.Contains("st")) {
                    add.Replace("st", "Street") ; 
                }
                addresses[i] = add; 
            }

Open in new window

0

.NET Programming

132K

Solutions

38K

Contributors

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.