|
You can't convert a bitmap to a web control.
What is it that you want to do?
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi All,
I have paging property true in my Datagrid Page. Now ther is Search Creteria in that page.When I click on Search, the Records are Displayed. Now the Problem is that, For Example I have 10 Pages before Search, I got 2 Pages After Search. When I click on the Second Page, All the Pages are Displayed again, not only My Search Second Page.
Any Idea.
Thanks in Advance.
Khan.
|
|
|
|
|
hi Safecom.cn, how are you ?
well your problem is nothing...your code is working fine, but you have not handle paging properly..
first make one PagedDatasource oblect...
then in one DataTable get your search result....give that DataTable to PagedDataSource as Datasource...
Now bing this PagedDataSource to your DataGrid....
then when you clcik on search, result will be saved in paged data source and then to datagrid..so now your datasource is only searched result.
also set "Paging" property of PagedDataSource to "true"...
try it..if not working then reply me..i will help you..
Bye have a nice day...
Chirag Patel
|
|
|
|
|
Thank u very much for Help.
Here is my Load function
<b>Public Sub DgBound()
Try
If (Conn.State <> ConnectionState.Open) Then
Conn.Open()
End If
strQry = "Select cust_order.order_id as order_id, cust_order.customer_id as cust_id, cust_order.order_date as order_date, customers.fname as fname, customers.lname as lname from cust_order, customers, cust_order_ship where cust_order.customer_id = customers.customer_id and cust_order.order_id = cust_order_ship.order_id"
Command = New OleDbCommand
With Command
.Connection = Conn
.CommandText = strQry
.CommandType = CommandType.Text
End With
da = New OleDbDataAdapter(strQry, Conn)
da.SelectCommand = Command
ds = New DataSet
da.Fill(ds, "cust")
dgProfit.DataSource = ds
dgProfit.DataBind()
totalreclbl.Text = ds.Tables(0).Rows.Count
Catch ex As Exception
Response.Write(ex.ToString)
Finally
Conn.Close()
End Try
End Sub</b>
and Here is My Search Code
Try
If (Conn.State <> ConnectionState.Open) Then
Conn.Open()
End If
strQry = "Select cust_order.order_id as order_id, cust_order.customer_id as cust_id, cust_order.order_date as order_date, customers.fname as fname, customers.lname as lname from cust_order, customers, cust_order_ship where cust_order.customer_id = customers.customer_id and cust_order.order_id = cust_order_ship.order_id and cust_order.order_date >=#" & ViewState("startDate") & "# and cust_order.order_date <=#" & ViewState("endDate") & "#"
Command = New OleDbCommand
With Command
.Connection = Conn
.CommandText = strQry
.CommandType = CommandType.Text
End With
Command2 = New OleDbCommand(strQry, Conn)
total = Command2.ExecuteReader()
If Not total.Read() Then
lblMsg.Visible = True
Else
lblMsg.Visible = False
End If
da = New OleDbDataAdapter(strQry, Conn)
da.SelectCommand = Command
ds = New DataSet
da.Fill(ds)
dgProfit.CurrentPageIndex = 0
dgProfit.DataSource = ds
totalreclbl.Text = ds.Tables(0).Rows.Count
dgProfit.DataBind()
btnBack.Visible = True
totVatSubSearch()
txtStart.Text = ""
txtEnd.Text = ""
Catch ex As Exception
Response.Write(ex.ToString)
Finally
Conn.Close()
End Try
I dont know where should I change my code.
Once Again Thank u very much.
|
|
|
|
|
I works fine.
But After Search When I click on a page, All the pages are loaded again. I need only search result pages, after search .
|
|
|
|
|
hi ...
your problem is like ...your code is loading datagrid with total result..because ithink you have not write that "Public Sub DgBound()" function in "Page_Load" event...
you should wirite
page_load(...)
{
if(!Page.IsPostBack)
{
//then here you can call "Public Sub DgBound()" function...
}
}
amd in search button click event write your search code...
do remember use Dataset and datatable static and declare them public and globally...and use only one dataset or datatable to bing in "Public Sub DgBound()" function as well as in "Search" code...
try this..
bye..
Chirag Patel
|
|
|
|
|
Hi friends
I am working in asp.net 2.0(c#).
I have image control in which image is displyed from fingerprint scanner.
now i want to know how to insert image in database.
plz help me out.
thanks in advance
GOD HELP THOSE WHO HELP THEMSELF
|
|
|
|
|
hey man send me ur email i'll send u complete code. don't worry its so easy. my id is kabhi__kabhi@hotmail.com
|
|
|
|
|
hi code project friends,
i have rewrite the url in Global.asax file in function "Application_BeginRequest(object sender, EventArgs e)"
string path = "~/Default.aspx?PersonalDigits=" + personalUrldigits;
HttpContext.Current.RewritePath(path);
My problem is, this code will successfully rewrite the url and process as per requirement, but when this page is displayed in browser then images will not be shown...
can you please help me why this is happening...?
Chirag Patel
|
|
|
|
|
maybe. you can move your function for rewriting URL to base page..
I'm also using URL rewriting features in my project. I wrote it in basepage. it's working fine.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Dear All ,
I am bit new to dotnet .
I am making small web application using C#, ASp.net , sql2000 using VIsual studio 2005.
I want to know how can i display message for the user before saving the data. and after only he say yes then save the corresponding data.i had tried with the following code
result = MessageBox.Show("Do you want to save the record", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
cmd.ExecuteNonQuery();
MessageBox.Show("Successfully Saved ", "Successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
)
But it showing following error
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
please Help.
Thanks
regards
imran khan
|
|
|
|
|
Dear Khan
U can't that Message Box for Web Application. That is for Desktop Application. U can use the following on the Save Button .
<asp:button id="save" runat="server" Text="Save" OnClientClick="return confirm(Save Now?')" />
|
|
|
|
|
|
Install this software and you got yourself an online shop to sell ANYTHING!
..and run a professional internet business that will work for you 24/7, so you have the freedom to quit your job and do things you really want to do with your time.
You are bidding for a single license copy of a newly online shop software to operate a single online shop.
* Automatic shipping fee calculation
* Unlimited number of items and categories
* Order and Accounts Manager
* Customize timeZone Support
* Customize Stock State Support
* Batch update Product price, desc, stock state
* News Manager
* AJAX support
Please Visit http://www.nzmk.com[^] to find out more!
|
|
|
|
|
HI
My website doesn't display the logo image from when viewing from remote computer. is there a security setting that I need to set it?
Thanks,
eyungwah.
|
|
|
|
|
It sounds more like you have used the path to the image on your hard drive instead of the url to the image in the web site.
---
single minded; short sighted; long gone;
|
|
|
|
|
hi Eyungwah, how are you,
do not worry about your problem...just make simple changes as i tell you you will get desired out put on remote server...
Remember ..
1. do not give physical path of your Pc in any of (images,pages,url....)...You should write all path with precceding "~/" sign...
For example..suppose you want to give path of "myphoto.jpg" from folder "Images" in you project..then simply write
src="~/Images/myphoto.jpg"....simple..
apply same trick on each pageurl or imageurl...
Bye have a nice day...
Chirag Patel
|
|
|
|
|
Hi Chirag,
Thank you for your replied. I'd tried as you suggested. I'm using VS 2005. On MasterPage.master page, originally I have src="/Images/myphoto.jpg" as soon as I changed to src="~/lab/Images/myphoto.jpg"; the pix disappeared from the Design page of MasterPage.master.
|
|
|
|
|
-i wonder how to be a "Root Admin" "Administrator" and etc...user,could it be in the Asp.net Website Administration tool?if it is.how can it be done?how can i deny simple user or anonymous user to access all the file in the database?
-another is,could it be possible that i can create a database where the username column have now values and the user will decided for its own password for security?can be possible..for example my username stored in the database and i will sign up for its password,that will directly store in the database...and whenever i visited the site,i can now access the site...
--Just like myspace and other website that the user has its own "my settings"where the own user has its own control to his page..where to make it?could i be used "master page"???How can it be done??im thinking of a 1 default page or default.aspx web form,that every user default page whenever the user visit the website? does anyone would tell me how can it be done??
--im using a visual web developer and asp.net 2.0 to build the website,what could be the most precised website for that rather than codeproject for more tutorial??
--thanks for the answer
-- modified at 2:18 Saturday 10th March, 2007
|
|
|
|
|
HI:
I have a website in Website1 folder that require user to Login first then directed to default.aspx page.
If user try to copy "http://localhost/website1/default.aspx. How can I prevent user from copy my default.aspx onto the URL to bypass the Login.aspx page first.
Thanks in advance,
Eyungwah
|
|
|
|
|
Turn off anonymous access and then the page will auto re-direct to your login page if you are doing forms authentication.
A sample web.config is below.
The deny user="?" is what will deny anonymous access. The loginUrl is what will redirect to your login page.
<configuration>
<system.web>
<authentication mode="Forms">
<forms loginUrl="login.aspx" />
</authentication>
<authorization>
<deny user="?" />
</authorization>
</system.web>
</configuration>
Hope that helps.
Ben
|
|
|
|
|
Thanks Ben for your replied.
It works but I have some other issue though. On my Login.aspx page I have a Hyperlink for PasswordRecovery.aspx page. The Link stop working. Is there an alternate solution to make this Link working in case user forgotpassword.
Thanks,
eyungwah
|
|
|
|
|
Well, I guess what you would want to do is to create a new subfolder. In that subfolder you can have another web.config that has an allow statement so that "?" Anonymous users are allowed to access pages in that subdirectory. You can also put a location section with a path in it.
So it is like
<location path="yoursubdirectory">
Do the allow authorization stuff here
Hope that helps.
Ben
|
|
|
|
|
1) i have a template image column. i want to use different images, suppose if database row contains a doctype as pdf then show a small pdf image in the template column image, if its doc then show a small doc image in the template column image.
2) I also have a template button column on click of which i want to open the location of file associated with that particular row which is also stored in the database.
Please help me in this regard.
Thankyou
Bye
|
|
|
|
|
(1)
In item create event fire (for 2.0 Row data bound) of data grid while loading the row from the database
in this event you can check and set the image url.
(2) When you click on the button the item comman (for 2.0 Row command) event fire. you can as per your requirement.
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|