Click here to Skip to main content
14,739,737 members

Comments by RiswanulZaman (Top 15 by date)

RiswanulZaman 21-Apr-14 2:24am View
   
hai thank u for ur solution.. and i wanna know one more thing which is how much data we can store in local storage?
RiswanulZaman 21-Mar-14 8:00am View
   
thank u for suggestion its very useful for me... i have found the solution with the help of ur code... and also i have done with some extra lines of code that is...


Dim inputStream As Stream = HttpContext.Current.Request.InputStream
inputStream.CopyTo(fileStream)

After execution of these lines.. we can get the length of the file...


Thank u friend.....
RiswanulZaman 21-Mar-14 7:17am View
   
Dim fileStream As New IO.FileStream(mapPath & "\" & filename, FileMode.OpenOrCreate)
If (fileStream.Length) > 50000 Then
System.Web.HttpContext.Current.Response.Write("{success:false, errmsg:'File size is large imagesize}")
Exit Sub
End If


this is my code.. here fileStream.Length is getting 0... i cant able to write file into the path..(tempfolder)
RiswanulZaman 19-Feb-14 1:34am View
   
This is my code from this code i wanna bind link button and i need to do perform action for the link button
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

$(document).ready(function () {

//GetDetails();
$.ajax({

type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
url: "JSON.aspx/LoadData",
data: "{}",
success: function (response) {
BindTable(response.d);
},
failure: function (data) {
alert('error');
}
});

});



function BindTable(sam) {

var div = document.getElementById('divTbl');
try {

var tbl = document.getElementById('newtable');
if (tbl.id != null) {
div.removeChild(tbl);
}

}
catch (e) {

}

var tab = document.createElement('table');
tab.setAttribute('id', 'newtable');
tab.setAttribute('cellpadding', '0');
tab.setAttribute('cellspacing', '0');
tab.setAttribute('width', '100%');

var body = document.createElement('tbody');
var trow, cell;
var i;

$.each(sam, function (index, emp) {

trow = document.createElement("tr");

for (i = 0; i < 4; i++) {

cell = document.createElement('td');
cell.setAttribute('width', '200px');

var id = emp.Id;
var name = emp.Name;
var code = emp.Code;
var add = emp.Address;
var email = emp.Email;

if (i == 0) {

var hfd = document.createElement('input');
hfd.setAttribute('type', 'hidden');
hfd.setAttribute('id', 'hfd_' + id);
hfd.setAttribute('value', id);
cell.setAttribute("width", "200px")
cell.appendChild(hfd);
cell.appendChild(document.createTextNode(name));

}

else if (i == 1) {

cell.setAttribute("width", "200px");
cell.appendChild(document.createTextNode(code));
}

else if (i == 2) {

var span = document.createElement('span');
cell.setAttribute("width", "200px");
span.setAttribute("display", "inline-block");
span.appendChild(document.createTextNode(email));
cell.appendChild(span);

}

else if (i == 3) {
cell.setAttribute("width", "200px");
cell.appendChild(document.createTextNode(add));
}

trow.appendChild(cell);
}
body.appendChild(trow);

});

tab.appendChild(body);
div.appendChild(tab);

}
RiswanulZaman 12-Feb-14 4:02am View
   
Sir,
Sorry to Disturb u..
How to Bind Link button In grid View also wanna know about bind command argument of the Link Button
RiswanulZaman 12-Feb-14 1:12am View
   
very sorry.. this is my mistake only.... i have wrongly mentioned the name of the aspx page...thats why i was getting error now only i have noticed that...
RiswanulZaman 12-Feb-14 1:06am View
   
ok i'll tell u completely... i fetching data from db and bind to grid by using json. while binding data i am facing the error which is undefined error from the script block..
I have using web method for fetching data. i have put the break point on " webmethod " and that web method i have called from script... now i am not able to get cursor on the break point.. and giving error msg like undefined error
RiswanulZaman 12-Feb-14 1:05am View
   
ok i'll tell u completely... i fetching data from db and bind to grid by using json. while binding data i am facing the error which is undefined error from the script block..
I have using web method for fetching data. i have put the break point on " webmethod " and that web method i have called from script... now i am not able to get cursor on the break point.. and giving error msg like undefined error
RiswanulZaman 12-Feb-14 0:56am View
   
i got the error in script block...
that is Error:undefined
RiswanulZaman 12-Feb-14 0:27am View
   
i am facing error from the following coding...
can plz tell me how to solve this
This is my code


<script type="text/javascript">
$(function () {
$.ajax({
type: "POST",
url: "BindGridViewusingJQuery.aspx/GetUserInfoData",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert("Failure : " + response.d);
},
error: function (response) {
alert("Error : " + response.d);
}
});
});

function OnSuccess(response) {
var xmlDoc = $.parseXML(response.d);
var xml = $(xmlDoc);
var users = xml.find("Table");
//create a new row from the last row of gridview
var row = $("[id*=grid] tr:last-child").clone(true);
//remove the lst row created by binding the dummy row from code behind on page load
$("[id*=grid] tr").not($("[id*=grid] tr:first-child")).remove();
var count = 1;
$.each(users, function () {
var users = $(this);
$("td", row).eq(1).html($(this).find("Name").text());
$("td", row).eq(2).html($(this).find("Subject").text());
$("td", row).eq(3).html($(this).find("Description").text());
$("td", row).eq(0).html($(this).find("Id").text());
$("[id*=grid]").append(row);
//define the background stryle of newly created row
if (count == 1 || (count % 2 != 0)) {
$(row).css("background-color", "#ffffff");
}
else {
$(row).css("background-color", "#D2CDCD");
}
count = count + 1;
row = $("[id*=grid] tr:last-child").clone(true);
});
}

</script>


<asp:GridView ID="grid" runat="server" AutoGenerateColumns="false" DataKeyNames="Id"
DataMember="Id">
<columns>
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Subject" HeaderText="Subject" />
<asp:BoundField DataField="Description" HeaderText="Description" />




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

If Not Page.IsPostBack Then

Call BindDummyRow()

End If

End Sub

Private Sub BindDummyRow()

Try

Dim mTable As New DataTable
mTable.Columns.Add("Name")
mTable.Columns.Add("SubJect")
mTable.Columns.Add("Description")
mTable.Columns.Add("Id")
mTable.Rows.Add()
grid.DataSource = mTable
grid.DataBind()
Catch ex As Exception
MsgBox(ex.ToString)
End Try

End Sub


<webmethod()> _
Public Shared Function GetUserInfoData() As String
Dim mString As String = ConfigurationManager.ConnectionStrings("ApplicationServices").ConnectionString
Dim ds As New DataSet
Using con As New SqlConnection(mString)
con.Open()
Using cmd As SqlCommand = con.CreateCommand
cmd.CommandType = Data.CommandType.Text
cmd.CommandText = " SELECT * FROM [dbo].[TEMP_User]"
Dim da As New SqlDataAdapter(cmd)
da.Fill(ds, "Table")
Return ds.GetXml()
con.Close()
End Using
End Using
End Function
RiswanulZaman 12-Feb-14 0:20am View
   
Thank u for ur reply...
i have done something... but i am facing error on that coding...
This is my code


<script type="text/javascript">
$(function () {
$.ajax({
type: "POST",
url: "BindGridViewusingJQuery.aspx/GetUserInfoData",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert("Failure : " + response.d);
},
error: function (response) {
alert("Error : " + response.d);
}
});
});

function OnSuccess(response) {
var xmlDoc = $.parseXML(response.d);
var xml = $(xmlDoc);
var users = xml.find("Table");
//create a new row from the last row of gridview
var row = $("[id*=grid] tr:last-child").clone(true);
//remove the lst row created by binding the dummy row from code behind on page load
$("[id*=grid] tr").not($("[id*=grid] tr:first-child")).remove();
var count = 1;
$.each(users, function () {
var users = $(this);
$("td", row).eq(1).html($(this).find("Name").text());
$("td", row).eq(2).html($(this).find("Subject").text());
$("td", row).eq(3).html($(this).find("Description").text());
$("td", row).eq(0).html($(this).find("Id").text());
$("[id*=grid]").append(row);
//define the background stryle of newly created row
if (count == 1 || (count % 2 != 0)) {
$(row).css("background-color", "#ffffff");
}
else {
$(row).css("background-color", "#D2CDCD");
}
count = count + 1;
row = $("[id*=grid] tr:last-child").clone(true);
});
}

</script>


<asp:GridView ID="grid" runat="server" AutoGenerateColumns="false" DataKeyNames="Id"
DataMember="Id">
<columns>
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Subject" HeaderText="Subject" />
<asp:BoundField DataField="Description" HeaderText="Description" />




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

If Not Page.IsPostBack Then

Call BindDummyRow()

End If

End Sub

Private Sub BindDummyRow()

Try

Dim mTable As New DataTable
mTable.Columns.Add("Name")
mTable.Columns.Add("SubJect")
mTable.Columns.Add("Description")
mTable.Columns.Add("Id")
mTable.Rows.Add()
grid.DataSource = mTable
grid.DataBind()
Catch ex As Exception
MsgBox(ex.ToString)
End Try

End Sub


<webmethod()> _
Public Shared Function GetUserInfoData() As String
Dim mString As String = ConfigurationManager.ConnectionStrings("ApplicationServices").ConnectionString
Dim ds As New DataSet
Using con As New SqlConnection(mString)
con.Open()
Using cmd As SqlCommand = con.CreateCommand
cmd.CommandType = Data.CommandType.Text
cmd.CommandText = " SELECT * FROM [dbo].[TEMP_User]"
Dim da As New SqlDataAdapter(cmd)
da.Fill(ds, "Table")
Return ds.GetXml()
con.Close()
End Using
End Using
End Function
RiswanulZaman 24-Aug-12 6:45am View
   
Sorry,,,, i understood.. and Thanks for ur reply
RiswanulZaman 24-Aug-12 6:35am View
   
Hai...

How to get access of Google safe search setting without using any web service(api)..? Is it Possible???
RiswanulZaman 24-Aug-12 2:33am View
   
Is there any other solution for that????
RiswanulZaman 24-Aug-12 2:27am View
   
Deleted
Is there any other solution for that????