16,011,784 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Rohit Sharma706 (Top 39 by date)
Rohit Sharma706
28-Jun-18 14:23pm
View
Thanks for ur valuable answer, but i already applied as ur given link, But i want as above post, I have DataTable of city and Area, how can i do the code to get as above formate,
---------------------------------
DataSet dsCS = Objbl.Fill_Grid("GetCountryandState", new string[] //Objbl.Fill_Grid("GetArea", new string[]
{
"View"
});
this.Context.Response.ContentType = "application/json; charset=utf-8";
this.Context.Response.Write(GetJSON(dsCS));
-------------------------------------------------------------------------------
public string GetJSON(DataSet ds)
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
ArrayList root = new ArrayList();
List<Dictionary<string, object>> table;
Dictionary<string, object> data;
foreach (DataTable dt in ds.Tables)
{
table = new List<Dictionary<string, object>>();
foreach (DataRow dr in dt.Rows)
{
data = new Dictionary<string, object>();
foreach (DataColumn col in dt.Columns)
{
data.Add(col.ColumnName, dr[col]);
}
table.Add(data);
}
root.Add(table);
}
return serializer.Serialize(root);
}
-----------------------------------------------------------------------------
I am using this code but unable to get the above format. So please help me
Rohit Sharma706
15-Dec-15 5:13am
View
thank you very much 4 your reply, but as per you link, that type of dialog box is not appear when i publish the app.
i am working on web application not in website
Rohit Sharma706
24-Dec-13 8:02am
View
With this local ip address i can trace the user in future.
Rohit Sharma706
4-Apr-13 0:54am
View
thank u very much...its work
Rohit Sharma706
17-Dec-12 23:19pm
View
ya u r correct i done it.
Rohit Sharma706
29-Nov-12 23:55pm
View
thnx for rply.
its work to get the value on select query but when bind this value to datatable (dtLink = query.CopyToDataTable();) then i get an error "The source contains no DataRows."
so if you have any idea how to bind it into datatable then plz suggest me.
Rohit Sharma706
29-Nov-12 7:39am
View
thx for rply.
but sorry to say that your suggestion is not working because its argument exception over Field<t>
Rohit Sharma706
11-Sep-12 0:35am
View
thanks for reply.i can't go for WPF.any other option.
Rohit Sharma706
10-Sep-12 8:26am
View
thnks for replay.
it take to much time.if any other option on design point of view.
Rohit Sharma706
10-Sep-12 8:02am
View
thanks for reply.
can you tell without DevExpress how can i do it.
Rohit Sharma706
29-Aug-12 3:20am
View
thanks very much for your reply.
you say that separate mobile site,it means i make a website for mobile.can you explain in details.
Rohit Sharma706
28-Jul-12 0:12am
View
Thaks Santosh ji.
its working.Thanks a lot.
Rohit Sharma706
27-Jul-12 8:54am
View
i done in this way but only single value is fetch
use just see that....
sqlSelect = "select AI_Center_Name from tbl_CenterEntry";
dt = cls.FetchDataTable(sqlSelect);
sqlSelect = "select AI_PriCenter_Name from tbl_PrivateCenterEntry";
dt1 = cls.FetchDataTable(sqlSelect);
dt.Merge(dt1);
dt3 = dt;
drpCenter.DisplayMember = "AI_PriCenter_Name";
drpCenter.ValueMember = "AI_Center_Name";
drpCenter.DataSource = dt3;
Rohit Sharma706
10-Jul-12 2:05am
View
Deleted
use this.
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Data Insert Successfully...');", true);
Rohit Sharma706
28-Apr-12 4:31am
View
sorry its my mistake there is a no semicolon.
update
tblGallery
set
Caption = @Caption,
ImageName =@Caption+'_'+ @GalleryID +'.jpg'
where
GalleryID = @GalleryID
Rohit Sharma706
19-Jan-12 3:07am
View
Thanks for reply
i already pass the link of the images that i have saved in the Joint folder.like
that one (../Admin/AdminImage/Photo/Gallery/JOINT/) but in JOINT folder again a folder create with id of image like folder name 1 and than image is save 1.jpg.
this is overall process.i hope you understand.
thanks.
Rohit Sharma706
21-Dec-11 7:43am
View
thanks for reply sir,
streamwriter write a HTML code step by step. i got your answer but my problem is that i store the html code into session as you can see above.
that store html code i want to display it in design view like html page.
i hope you understand and you can help me.
Rohit Sharma706
17-Dec-11 4:02am
View
Thanks for your reply.
Actually my website is in HTML. Sometimes i want to change it contents and pictures. But every time i have to change the content and image in my computer and then upload it to get the effect. Now i want this section in my webpage in different section called "Admin". Where all the html pages are in a dropdown menu. For each selection content and pictures are came into editable mode. Hope i can explain you my question properly.
Now please give me a suggestion as per question.
Rohit Sharma706
16-Dec-11 7:37am
View
thanks sir,
i understand that if you give me a example that is good for me.
Rohit Sharma706
18-Nov-11 2:56am
View
Thank you i solve these problem like these...
http://www.c-sharpcorner.com/uploadfile/prathore/image-popup-using-jquery/
Rohit Sharma706
18-Nov-11 2:55am
View
Thank you. I solve it. usefull link below....
http://www.c-sharpcorner.com/uploadfile/prathore/image-popup-using-jquery/
Rohit Sharma706
17-Nov-11 3:01am
View
code behind web service part like these....
[System.Web.Services.WebMethod(), System.Web.Script.Services.ScriptMethodAttribute()]
public static string GetDynamicContent(string contextKey)
{
string constr = "connection string";
string query = "SELECT ImagePath FROM imagetable WHERE id = " + contextKey;
SqlDataAdapter da = new SqlDataAdapter(query, constr);
DataTable table = new DataTable();
da.Fill(table);
string x = table.Rows[0]["ImagePath"].ToString();
return x.ToString();
}
Rohit Sharma706
17-Nov-11 2:58am
View
My .aspx page Form section like these...
<form id="form1" runat="server">
<div>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" enablepagemethods="true">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<columns> <asp:BoundField DataField="id" HeaderText="Image ID" />
<asp:TemplateField>
<itemtemplate>
<asp:ImageButton ID="imgBtnTour" runat="server" ImageUrl='<%#DataBinder.Eval(Container.DataItem,"ImagePath") %>' Width="80" OnClientClick="return ShowPopup();"/>
<asp:Button runat="server" ID="btnHiddenPopUp" Style="display: none" />
<asp:ModalPopupExtender ID="mpeTest" runat="server" TargetControlID="btnHiddenPopUp"
PopupControlID="panSaving" BackgroundCssClass="modalBackground" DropShadow="true"
RepositionMode="RepositionOnWindowResize" CancelControlID="imgClose" DynamicServiceMethod="GetDynamicContent" DynamicContextKey='<%# Eval("id") %>' DynamicControlID="imgClose"/>
<asp:Panel runat="server" CssClass="modalPopup" ID="panSaving" Style="display: none">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<asp:Image ID="imgClose" runat="server" ImageUrl='pics/Koala.jpg' Height="336" Width="430"/>
</td>
</tr>
</table>
</div>
</form>
....
script section like these...
<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function ShowPopup() {
//show modal popup window
var modalWindow = '<%= mpeTest.ClientID %>';
$find(modalWindow).show();
//add event handler to hide the modal popup when user click background of the popup window
var backgroundElement = $get(modalWindow + '_backgroundElement');
if (backgroundElement) $addHandler(backgroundElement, 'click', hideModalPopupViaClient);
return false;
}
function hideModalPopupViaClient() {
//hide modal popup window
var modalPopupBehavior = $find('<%= mpeTest.ClientID %>');
if (modalPopupBehavior) {
modalPopupBehavior.hide();
}
}
function Test(contextKey) {
PageMethods.GetDynamicContent(contextKey,
OnSucceeded, OnFailed);
}
function OnSucceeded() {
// Dispaly "thank you."
// write javascript code to bind image path
var img = document.getElementById[imgClose];
img.src = x;
//alert("Thank u")
}
function OnFailed(error) {
// Alert user to the error.
alert(error.get_message());
}
</script>
......
Rohit Sharma706
17-Nov-11 2:30am
View
at
<asp:ScriptManager ID="ScriptManager1" runat="server" enablepagemethods="true" xmlns:asp="#unknown">
it showing these error...
Parser Error Message: Type 'System.Web.UI.ScriptManager' does not have a public property named 'xmlns:asp'.
so i try with this
<asp:ScriptManager ID="ScriptManager1" runat="server" enablepagemethods="true">
but popup image not display... if i do wrong at..
var img = document.getElementById(imgClose)
img.ImageUrl=x.tostring()
Thank you.
Rohit Sharma706
17-Nov-11 2:20am
View
Like these also i check...
var img = document.getElementById(imgClose)
img.ImageUrl=x.tostring().....is it have some problem in these two line. Thank You.
Rohit Sharma706
17-Nov-11 2:18am
View
First of all Thanx...i try with these..like these....
function Test(contextKey)
{
PageMethods.GetDynamicContent(contextKey,
OnSucceeded, OnFailed);
}
function OnSucceeded() {
// Dispaly "thank you."
// write javascript code to bind image path
// var img = document.getElementById("imgClose");
// img.ImageUrl=x.tostring()
//alert("Thank u")
}
function OnFailed(error) {
// Alert user to the error.
alert(error.get_message());
}
....
var img = document.getElementById("imgClose");
img.ImageUrl=x.tostring().....is it have some problem in these two line. Thank You.
Rohit Sharma706
15-Nov-11 2:18am
View
Thanks very much
sir its working.
Rohit Sharma706
15-Nov-11 1:37am
View
sorry sir i can't understand.if you dont mind can you explain it.
my gridview like that.
........................
<asp:GridView ID="GridView1" runat="server" BorderWidth="5px" AutoGenerateColumns="False" AllowSorting="True" AutoGenerateEditButton="True" OnRowEditing="GridView1_RowEditing" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowUpdating="GridView1_RowUpdating" BackColor="" BorderColor="SaddleBrown" BorderStyle="None" CellPadding="4" ForeColor="#333333" GridLines="None" PageSize="20">
<columns>
<asp:TemplateField HeaderText ="IDNO"><itemtemplate><asp:Label ID="lblid" runat ="server" Text ='<%#Eval("entry_id") %>' >
<asp:TemplateField HeaderText="Item" ><itemtemplate> <%#Eval("item")%>
<asp:TemplateField HeaderText="Category" ><itemtemplate> <%#Eval("category")%>
<asp:TemplateField HeaderText="Unit" ><itemtemplate> <%#Eval("unit")%>
<asp:TemplateField HeaderText ="Revenue"><itemtemplate><asp:Label ID="lblid1" runat ="server" Text ='<%#Eval("rev") %>' >
<asp:TemplateField HeaderText ="Quantity"><itemtemplate><%#Eval("qty")%>
<edititemtemplate>
<asp:TextBox ID="textbox2" runat ="server" Text ='<%#Eval("qty") %>'>
<asp:TemplateField HeaderText="Amount" ><itemtemplate> <%#Eval("amount")%>
<asp:CommandField
<footerstyle backcolor="#990000" font-bold="True" forecolor="White">
<rowstyle backcolor="#FFFBD6" forecolor="#333333">
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<HeaderStyle BackColor="#7AB915" Font-Bold="True" ForeColor="White" />
<alternatingrowstyle backcolor="#CCFF99">
Rohit Sharma706
18-Oct-11 3:59am
View
But sir i want new line for every comments i try in that way
ToolTip='<%# "COMMANTS:-"+ DataBinder.Eval(Container,"DataItem.CommentsFromRoyalSikkim") +"\n" + "NOTE:-"+ DataBinder.Eval(Container,"DataItem.NoteFromHotel")+"\n"+ " STAR RATING:-"+ DataBinder.Eval(Container,"DataItem.StarRateID")
but it's not working.
can you give me a idea.(all are in design page)
Rohit Sharma706
18-Oct-11 3:44am
View
thank for reply.
i do that in that way
ToolTip='<%# "COMMANTS:-"+ DataBinder.Eval(Container,"DataItem.CommentsFromRoyalSikkim") +"" + "NOTE:-"+ DataBinder.Eval(Container,"DataItem.NoteFromHotel")+""+ " STAR RATING:-"+ DataBinder.Eval(Container,"DataItem.StarRateID")+"Star"+ " OUR RATING-:"+ DataBinder.Eval(Container,"DataItem.OurRateID")+"Star"+" ROAD APPROCH:-"+ DataBinder.Eval(Container,"DataItem.RoadApproachID")+" DISTANCE FROM TOWN:-"+ DataBinder.Eval(Container,"DataItem.DistanceFromTown")%> '
Rohit Sharma706
22-Sep-11 5:41am
View
Sir don't mind i totally confuse.can you told How to applied that.
This is my vb page
Protected Sub gvList_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles gvList.RowDeleting
Using conn As New SqlConnection(ConfigurationManager.ConnectionStrings("AnimalHusbandry").ConnectionString)
Try
Dim qu As String = "select [FormType_ID] from [Forms]"
Dim da As SqlDataAdapter = New SqlDataAdapter(qu, conn)
Dim dt As DataTable = New DataTable()
da.Fill(dt)
Dim start As Integer = 0
Dim Endvalue As Integer = dt.Rows.Count - 1
If (Endvalue >= 0) Then
For value As Integer = start To Endvalue
Dim o As String
Dim a As String
'o = dt.Rows.Item(i).Item("ReportType_ID")
o = dt.Rows.Item(value).Item("FormType_ID")
a = gvList.DataKeys(e.RowIndex).Value.ToString
If (a = o) Then
'Dim strscript As String = "<script>alert('Record Deleted Successfully..');</script>"
' ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(Page), "alert", strscript, False)
' MessageBox.Show("Data Exist In Main Form! So, you can't delete from here.")
' MsgBox("Data Exist In Main Form! So, you can't delete from here.")
'Response.Write("<script language = 'javascript'>alert('the flag was succesful() ');</script>")
' Dim strScript As String = "<script language='javascript' id=’myClientScript’>test();</script>"
'Page.RegisterStartupScript("callTest", strScript)
'Dim strJs As String = "<script>alert('Record Deleted Successfully..');</script>"
'ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(Page), "alert", strJs, False)
'e.Cancel = True
'ObjFormType.SelectCountMethod = "GetAllFormType"
gvList.Attributes.Add("OnClientClick", "javascript:computeCorrectValue()")
'Dim script As String = String.Format("alert('this is alert');")
'ScriptManager.RegisterClientScriptBlock(Page, GetType(System.Web.UI.Page), "redirect", script, True)
'Dim BuildScript As New System.Text.StringBuilder
'BuildScript.Append("<script>")
'BuildScript.Append(Environment.NewLine)
'BuildScript.Append("alert('heLLO');")
'BuildScript.Append(Environment.NewLine)
'BuildScript.Append("")
'Page.RegisterStartupScript("MsgBoxJS", BuildScript.ToString())
Response.Redirect("FormType.aspx", False)
Exit For
Else
End If
Next value
clsFormType.DeleteFormType(gvList.DataKeys(e.RowIndex).Value)
Dim str As String = "<script>alert('Record Deleted Successfully..');</script>"
ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(Page), "alert", str, False)
ObjFormType.SelectCountMethod = "GetAllFormType"
e.Cancel = True
Else
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Using
' Response.Redirect("FormType.aspx")
'clsFormType.DeleteFormType(gvList.
Rohit Sharma706
22-Sep-11 4:12am
View
yes sir i try that one.but try that after showing message it Response.Redirect("ReportType.aspx").In that case give the error "Thread was being aborted".
I try that like
If (a = o) Then
Dim str As String = "<script>alert('Record Deleted Successfully..');</script>"
ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(Page), "alert", str, False)
Response.Redirect("ReportType.aspx")
but It Give error "Thread was being aborted".
Rohit Sharma706
22-Sep-11 0:51am
View
Thanks for reply sir,Now my confusion is clear.
But sir i don't no WPF.so,can you give me any alternative way to show this message.
Rohit Sharma706
12-Sep-11 7:56am
View
Thanks for reply
Yes sir you are wright this is happen to me.It is working Local server but when I upload than message is not working.
can you tell how can i solve that problem......
Rohit Sharma706
26-Aug-11 8:16am
View
ok.sir.
i want to know how to delete row in Excel sheet in c#.
so i do above coding by this [da.Update(dt);].i got delete value in datatable but it is not modify in Excel Sheet.as usual data in present.
Rohit Sharma706
25-Aug-11 9:07am
View
sir,I try that but it not working after fill data table it throw exception.
Rohit Sharma706
24-Aug-11 23:49pm
View
sir, can you tell how to handle null value
Rohit Sharma706
24-Aug-11 9:31am
View
thanks for your reply sir.
ds have a value.it is not a null.and index is specified with a value.
Rohit Sharma706
24-Aug-11 9:25am
View
thanks for your reply.But i send a particular index value over there.(index=37).
Show More