0% found this document useful (0 votes)
98 views9 pages

VbImportant Suff

The document contains links to various web resources on topics related to ASP.NET such as limiting string lengths, validating user input, adding controls and functionality to web forms, and connecting to databases. Code snippets are also provided for tasks like checking for empty gridviews and highlighting text fields.

Uploaded by

suebri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views9 pages

VbImportant Suff

The document contains links to various web resources on topics related to ASP.NET such as limiting string lengths, validating user input, adding controls and functionality to web forms, and connecting to databases. Code snippets are also provided for tasks like checking for empty gridviews and highlighting text fields.

Uploaded by

suebri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Limit no of characters that occur in a string

HyperLink myLink =
(HyperLink)e.Row.Cells[2].Controls[0];
string text = myLink.Text;
if (text.Length > 10)
{
myLink.Text = text.Substring(0, 10);

}
https://www.youtube.com/watch?v=Ygr6Sq5IRiA
http://forums.asp.net/t/1717606.aspx?
Popup+Message+Box+in+asp+net+c+
http://forums.asp.net/t/1594687.aspx?
Putting+A+Value+From+TextBox+to+Sql+Query

Document viewer

string checkUser = "SELECT count(*) FROM ClassListsTable


WHERE Group_Code =('" + TextBoxGroupCode.Text + "')AND
( StudentName='" + TextBoxName.Text + "')";

http://www.myaspweb.com/articals/chatpageA26.aspx

Chat room

http://www.codeproject.com/Tips/493405/Validating-UserInput-Containing-HTML-tags-in-ASP

For validation

using System.Text.RegularExpressions;

For regex

http://www.codeproject.com/Tips/173879/Load-allthe-Country-Names-of-the-World-in-DropDow

Add all countries to drop down box

<script>alert('Oops!')</script>

https://msdn.microsoft.com/enus/library/ff647397.aspx
https://www.owasp.org/index.php/Unrestricted_File_
Upload
http://www.codeproject.com/Questions/454188/Ho
w-do-i-solved-Timeout-expired-in-Asp-Net

security

http://www.codeproject.com/Questions/454188/Howdo-i-solved-Timeout-expired-in-Asp-Net

Highlight textfield

<tr>
<script src="jquery-1.11.3.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('INPUT[type="text"]').focus(function () {
$(this).addClass("focus");
});

$('INPUT[type="text"]').blur(function () {
$(this).removeClass("focus");
});
});
</script>
<style type="text/css">
.focus {
border: 2px solid red;
background-color: #FEFED5;
}

</style>

</tr>

By using trim() we can remove white space characters


from the beginning and end of a string.But to remove white
space characters in middle we cannot use trim() method.
we can easily remove the white spaces/empty space in a
string by replace method
string strSample = Test with white space;
strSample = strSample.Replace( , );
Result : strSample = Testwithwhitespace

https://www.youtube.com/watch?v=33sBZanzlII

Master page

https://www.youtube.com/watch?v=xvrr-gZ2UJQ

Add menu

int rowCount = GridView1.Rows.Count;


if (rowCount == 0)
{
GridView1.Visible = false;
}
else
{
GridView1.Visible = true;
}

Check if gridview empty

Embed video WPD800-56436-43532-24092


https://www.youtube.com/watch?v=vZIOI136IKY
https://www.youtube.com/watch?v=BqyAAGMfTD8
string pathString2 =
@"C:\Users\Shantell\Documents\Visual Studio
2013\WebSites\WebSite8\Users\" + TextBoxUn.Text;

https://www.youtube.com/watch?v=K7l1OGHNfeE
Edit and delete from gridview-good
Save image in database
Create folder called

System.IO.Directory.CreateDirectory(pathString2);

Immobilise
Purposehttps://www.youtube.com/watch?
v=ZeOyiEUy808

https://www.youtube.com/watch
?v=Ygr6Sq5IRiA
https://www.youtube.com/watch
?v=sd0grLQ4voU
http://www.csharpcorner.com/uploadfile/mah
esh/how-to-read-a-text-file-in-CSharp/

string SelectCommand= "Select * FROM [GroupName]"


UpdateCommand= "UPDATE [GroupName] Set
[Password]=@GroupPass=,[Form]=@Form,[Student]=@name
Where [id]= @id";

Free website

Open doc as html


Website design
Reading text files in c#

The methods of ckEditor

Re: how to save ckeditor data


into database?

http://docs.cksource.com/ckeditor_api/symbols/CKEDI
TOR.editor.html#insertHtml
https://www.youtube.com/watch?v=hs74fKPJpFw

creat a text file in c#

http://docs.cksource.com/CKEditor_3.x/Developers_
Guide/Integration
http://www.csharpcorner.com/UserRegistration/UserRegistration.
aspx?check=r&ReturnURL=%2fuploadfile
%2fscottlysle%2fword-processing-with-anextended-rich-text-box-control-in-vb%2f
http://menulab.com/richtextbox/documentation.asp
x
http://www.easyfreeware.com/find.php?
q=freeware+text+scroll+ocx+control
https://www.youtube.com/watch?v=Ct9EV5QT6Pk
http://menulab.com/richtextbox/

Integrate in website
Rich text editor with scrolbar

Methods of rich textbox


Add free controls
Richtext save
Adding richtextbox

Call one web page in another


Response.Redirect("weblocationlocation2/weba
pp2/default.aspx");
info between two web pages

2. Use Session.
Source page - Label2.Text =
GridView2.SelectedRow.Cells[1].Text;
string value = "uploads/" + Label2.Text;
Session["notelink"] = value; Destination page
(Session["notelink"] != null)
{
HyperLinkNotes.Text = "Download FILE";
HyperLinkNotes.Visible = true;

- if

Label1.Text = (string)Session["notelink"];
HyperLinkNotes.NavigateUrl = Label1.Text;

https://www.youtube.com/watch?v=mE3Qj4cI3Lc
https://www.youtube.com/watch?v=Dq0_ALqt0C0
http://www.dotnetfunda.com/articles/show/442/how-toget-the-values-of-selected-row-from-a-gridview-usingaspnet
~/uploads/Girl Scouts Amherst Camp Flyer (1).jpg
~/uploads/vbImportant suff.docx

WebSites\WebSite8\uploads\\GirlScoutsAmherstCampFl
yer(1).jpg
http://www.aspdotnetsuresh.com/2012/02/saveupload-files-in-folder-anddownload.html
<system.web>

Update in gridview
Upload multiple files-use
Get selected value in gridview

txtrowid .Text = Gridview1.SelectedRow.Cells[1].Text;


txtname .Text =
Gridview1.SelectedRow.Cells[2].Text;
txtmarks .Text =
Gridview1.SelectedRow.Cells[3].Text;

Increase file sze

<httpRuntime executionTimeout="9999"
maxRequestLength="2097151"/>
</system.web>

Insert Date into a textBox


Download a file
https://www.youtube.com/watch?v=yLgrR7wsV1Y
https://www.youtube.com/watch?v=yLgrR7wsV1Y
http://www.codeproject.com/Articles/1757/FileUpload-with-ASP-NET

TextBox2.Text = Date.Now()

https://www.youtube.com/watch?v=RtgveiamSYE

Fileupload code explained

Log in to yahoo at click of button


https://www.youtube.com/watch?v=KVlXccl-XBA
https://www.youtube.com/watch?v=KIZqQgqYCIg
https://www.youtube.com/watch?v=Nu_zREtF_X8
https://www.youtube.com/watch?v=hFy35XK6E6s
Autonumber in sql

https://www.youtube.com/watch?v=9EJXzWasTq4
Create data base for website
Connect to database
Generate GUID
Store doc in sql
1. CREATE TABLE NorthWindUsers
2.

(UserID INT IDENTITY(1,1) NOT


NULL,

3.

UserName VARCHAR(50) NOT


NULL,

4.

Password VARCHAR(50) NOT


NULL)

SqlConnection con = new SqlConnection(strConnString);


5.
con.Open();

for (int i = 0; i < DropDownList1.Items.Count; i++)

if (DropDownList1.Items[i].Selected == true)

str = "insert into employee1 values('" +


DropDownList1.Items[i].ToString() + "')";

com = new SqlCommand(str, con);

com.ExecuteNonQuery();

Response.Write("<script>alert('Items
Inserted');</script>");

}
http://dotnetawesome.blogspot.com/2013/11/how-toupload-multiple-file-with.html

Upload files to server

https://www.youtube.com/watch?v=MHLlin5g5yQ

You might also like