chander_rani wrote:
f = file.FileName;<br />
if (!string.IsNullOrEmpty(f))<br />
{<br />
f1 = adcode;<br />
f = f.Substring(f.LastIndexOf("."));<br />
f1 = "~/images/" + f1 + f;
I see that f is a string but on the part of f1 there is no other code to support if f1 is the integer and adcode the string or if adcode the integer and f1 the string, so the solution can go a few different ways.
if f1 is an integer and adcode is an integer then f1=adcode; is correct but f1 = "~/images/" + f1 + f; is incorrect because "/images/" cannot be converted to integer
if f1 is string and adcode is an integer then f1=adcode would be incorrect and to fix this just call as f1=adcode.ToString(); and f1 ="~/images/" + f1 + f; would display correctly.
if f1 is an integer and adcode is a string then it's all wrong. first only if adcode is equal to an integer example adcode="10"; could you call f1=adcode but it would have to be called as f1=Int32.Parse(adcode); and second f1="~/images/" + f1 + f; could not be called because "/images/" is not convertable to an integer.