|
Sir;
I don't think that you need a tab container, all you need is two spans with the attribute onclick set to GetPostbackEventReference() (or any thing can cause potback) , a div, and an update panel cotaning the grid.
so you can update the grid content every postback.
Good Louk
Help people,so poeple can help you.
|
|
|
|
|
Actually I need to show in the tab forms.. So I have multiple tabs in that page.
suchita
|
|
|
|
|
TabContainer is rendered somthing like
<span>Tab1</span>
<span>Tab2</span>
<div>Div1</div>
<div>Div2</div>
when you click a span (or tab header) the display of the assosiated div (tab body) is toggled to block and the other to none.
what i want you to do is drawing something that looks like a tab container with one div and no display toggling just like
<span>Tab1</span>
<span>Tab2</span>
<div>Div1
<asp:updatepanel ID="updatepanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" />
</ContentTemplate>
</ asp:updatepanel>
</div>
you can also use a tab container, but you will need to add the grid dynamically in the code (server side).
100
Help people,so poeple can help you.
|
|
|
|
|
HI all,
I am creating a webapplication in c#.net.In this apllication i am displaying files from the server.
Now what i want to do is , i want to download the selected file.
How can i do this ?
Thanks in advance.
|
|
|
|
|
This may help you. May be you need to tweak the code little bit. Give a try
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
namespace photoshops
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
onflbload(sender, e);
}
public void onflbload(object sender, EventArgs e)
{
int len = flbload.PostedFile.ContentLength;
byte[] pic = new byte[len];
flbload.PostedFile.InputStream.Read(pic, 0, len);
SqlConnection connection = new SqlConnection(@"Data Source=DEVI\SQLEXPRESS;
Initial Catalog =cat; Integrated Security=SSPI");
SqlConnection con = new SqlConnection();
con.ConnectionString = @"Data Source=DEVI\SQLEXPRESS; Initial Catalog =cat; Integrated Security=SSPI";
try
{
connection.Open();
SqlCommand cmd = new SqlCommand("insert into tblphotosettings " + "(BillNo,CustomerName,Address,StartDate,EndDate,Numberofcopies,) values (@BillNo,@CustomerName,@Address,@StartDate,@EndDate,@Numberofcopies,)", connection);
cmd.Parameters.Add("@BillNo", SqlDbType.NVarChar).Value = TextBox1.Text;
cmd.Parameters.Add("@CustomerName", SqlDbType.NVarChar).Value =TextBox2.Text;
cmd.Parameters.Add("@Address", SqlDbType.NVarChar).Value = TextBox3.Text;
cmd.Parameters.Add("@StartDate", SqlDbType.NVarChar).Value =Rdbsdate.SelectedDate;
cmd.Parameters.Add("@EndDate", SqlDbType.NVarChar).Value =Rdbddate.SelectedDate;
cmd.Parameters.Add("@Numberofcopies", SqlDbType.NVarChar).Value =TextBox7.Text;
cmd.CommandText = "photosets";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
cmd.Parameters.Add("@Systemurl", SqlDbType.Image).Value = pic;
SqlParameter Src = new SqlParameter("@FilePath", SqlDbType.VarChar, 450);
cmd.Parameters.Add("@Amount", SqlDbType.NVarChar).Value = TextBox8.Text;
cmd.Parameters.Add("@Total", SqlDbType.NVarChar).Value = TextBox9.Text;
cmd.Parameters.Add(Src);
con.Open();
cmd.ExecuteNonQuery();
}
finally
{
connection.Close();
}
}
}
}
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[photosets]
(
@Systemurl image,
@Filepath varchar,
@Amount NVarchar,
@Total NVarchar
)
AS
BEGIN
insert into tblphotosettings
(
Systemurl,
Filepath,
Amount,
Total
)
values
(
@Systemurl,
@Filepath,
@Amount,
@Total
)
END Procedure or function photosets has too many arguments specified.and then i need store to image and image path name and record
|
|
|
|
|
You're adding to your parameters in the following lines:
cmd.CommandText = "photosets";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
cmd.Parameters.Add("@Systemurl", SqlDbType.Image).Value = pic;
SqlParameter Src = new SqlParameter("@FilePath", SqlDbType.VarChar, 450);
cmd.Parameters.Add("@Amount", SqlDbType.NVarChar).Value = TextBox8.Text;
cmd.Parameters.Add("@Total", SqlDbType.NVarChar).Value = TextBox9.Text; The parameters collection has previously been assigned to by the command before it (even though you are changing the command you are issuing, you are still using the same command instance). Just before this, add the line
cmd.Parameters.Clear();
|
|
|
|
|
|
Hai Experts
I have done googlemap with single marker dynamically . i have tried same way for multiple marker where latitudes and longitudes comes from database .can u please suggest me How to approach.
Regards
venu
|
|
|
|
|
Venu,
I have used the control from subgurim to achieve what you are looking for. It works good. Have a look at it. Here is the
link
Thanks
|
|
|
|
|
Will you please post some code on how to make a persistence by making a page like igoogle.Sorry for bad english.
|
|
|
|
|
Sure.
private void MakePersistenceLayer()
{
IUnityContainer accessor = Context.ApplicationInstance as IUnityContainer;
if (accessor == null)
throw new ArgumentNullException("IUnityContainer should not be null");
IPersist persist = accessor.Resolve<Persister>();
persist.MakePersistent();
} There, I've given you a head start here. I leave it to you to fill in the trivial bits.
|
|
|
|
|
Hello all,
I am having a problem while refreshing my parent window.
I have a webform and I am using a viewstate on this form. on the viewstate's 3rd activeform I have a table. In a row of this table when the radiobutton's value is equal to No(I am doing an autopostback here) a popup window opens. Here on the popup window I make user to select some items in the checkbox list and carry the data to a textbox in the parent form. Till here everything is fine.
My problem is I can not close the popup. What happens is;
I can successfully pass the data to my parent window, refresh it but the popup windows closes and it popups again.
I am trying to do it with this code;
Page.RegisterStartupScript("CLOSE", "<script language='javascript'>window.opener.document.forms(0).submit();self.close();</script>");
What I also tried;
ClientScript.RegisterStartupScript(typeof(Page), "closePage", "window.onunload = CloseWindow();");
Page.RegisterStartupScript("CLOSE", "<script language='javascript'>window.opener.location.reload();self.close();</script>");
Page.RegisterStartupScript("CLOSE", "<script language='javascript'>window.opener.location.href = window.opener.location.href;self.close();</script>");
Page.RegisterStartupScript("CLOSE", "<script language='javascript'>window.opener.history.go(0) = window.opener.location.href;self.close()</script>");
These three doesnt work the way I want. They either popup the popup again, or close the popup, reload the parent but then parent goes back to Viewstate's active viewindex 1 instead of staying in 3.
Any ideas how can I fix this? Thanks
|
|
|
|
|
Hi,
I have a table in database for messages and it has these fields:
MessageId / SenderId / Message / Date
I'd like to create a list of messages but only show the latest message from each user not listing whole messages just like how facebook shows messages.
Is there a way to get the exact result by a sql query or I have to first get all the data from the database then build the list I want?
Thank you
|
|
|
|
|
You can do this (at least partially) in the db. For example:
SELECT ...
SUBSTRING(m.Message,1, 80) AS PartialMessage,
...
FROM Messages m
WHERE m.MessageID IN (SELECT MAX(m2.MessageId)
FROM Messages m2
GROUP BY m2.SenderId)
The above (with typos corrected etc ) should fetch the latest messsages for each sender and bring only first 80 characters of the message.
In the example I'm relying on a fact that the MessageId field is constantly growing number so it will order the messages correctly. If this is not true then you would have to use the date field to get the latest messages.
|
|
|
|
|
Farhad Eft wrote: Is there a way to get the exact result by a sql query
Yes if you want sorted data then use 'order by' statement.
if you want some condition data then use 'where' condition.
No need to get all the data from database and then build list.
|
|
|
|
|
Hi
In a Sql Server database we have a Patient table and a ReferHospital table. The ReferHospital table is a lookup table. There is a Foreign key column (RefHospID) in the Patient table.
In the past the Referring hospital was not a required input field, but it has become a required field for input recently.
I have a DetailsView on the page and I have made one of the fields a TemplateField. In the EditItemTemplate and InsertItemTemplate I have a DropdownList that is databound to the ReferringHospital table in the database.
So the two things I would like to achieve is:
1.) When an old patient record is loaded and the RefHospID field is null, the DropDownList must accept the null and display the initial value “- select -”.
2.) When a new patient is inserted (or an old patient edited) there must be a validation to check that the initial value “- select -” is not still selected, but that a RefHosp has been selected in the DropDownList.
I manage to get these two things working individually but not combined.
I set the AppendDataBoundItems property to true and added the initial value as a ListItem.
Markup of the DropdownList
<asp:DropDownList ID="DropDownList_HP" runat="server"
AppendDataBoundItems="True" DataSourceID="SqlDataSource_RefHosp"
DataTextField="HospName" DataValueField="HospID" SelectedValue='<%# Bind("HospID") %>' Enabled="True">
<asp:ListItem Selected="True" Value="">- select -</asp:ListItem>
</asp:DropDownList>
The code in bold is to enable the DropDownList to accept null values from the database. (This info I found at http://msdn.microsoft.com/en-us/library/ms366709.aspx )
I also added a RequiredFieldValidator to ensure that a value other than “- select -” is selected.
<asp:RequiredFieldValidator ID="RequiredFieldValidatorDV4" runat="server"
ControlToValidate="DropDownList_HP"
ErrorMessage="Select a referring hospital"
InitialValue="- select -" ValidationGroup="PatientInputGroupDV4"
SetFocusOnError="True"></asp:RequiredFieldValidator>
The problem is that without
Selected="True" Value=""
In the ListItem of the DropDownList an exception is thrown which says the DropDownList has “SelectedValue which is invalid because it does not exist in the list of items.”
And with
Selected="True" Value=""
The RequiredFieldValidator does not complain when ‘- select -’ is still selected when I want to update from the DetailsView.
Does anyone have any solutions for this problem.
Regards.
Kobus
|
|
|
|
|
You could use a RangeValidator rather than a RequireFieldValidator. Assuming the selected value for the default item (-select-) is -1, set the MinimumValue attribute to 0 and the MaximumValue attribute to some number beyond the expected number of items, say 9999
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
As per my understanding and according to your dropdownlist value, initial value should be blank of Required field validator.
<asp:RequiredFieldValidator ID="RequiredFieldValidatorDV4" runat="server"
ControlToValidate="DropDownList_HP"
ErrorMessage="Select a referring hospital"
InitialValue="" ValidationGroup="PatientInputGroupDV4"
SetFocusOnError="True"></asp:RequiredFieldValidator>
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
In required field validator set InitialValue="0" ;
Thank you.
|
|
|
|
|
Thank you prasanta_prince
In my RequiredFieldValidator I have set the InitialValue="" and it works great.
Regards.
Kobus
|
|
|
|
|
@kbalias, Good to know your problem is solved.
|
|
|
|
|
Hii All,
I am using below method to pass data to paypal.
"/
/ThankYou.aspx" />
" />
" />
Please help in calculating tax?
for singapore customer i need to charge 7%
Please help
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
Hi,
Is there any body who has done this before..??? how can i implement new skin in AuctionWorx.???
|
|
|
|
|
The best place for you to ask this is on the vendors support site[^]. It's highly unlikely that somebody cruising by the forum will just have happened to do this.
|
|
|
|